In python you can detect whether a script is executed as opposed import
ed by another script with this
if __name__ == '__main__':
# We are run directly.
Is there a way in to do the same in a shell script? I have a couple of functions in script that I would like to be able to source, without executing them.