One difference between sourcing and just running a script is that running the script spawns a child process, which dies when the script ends, taking with it all of your changes of directory and non-exported variable definitions and shell functions, while sourcing keeps them.
One difference between sourcing and just running a script is that running the script spawns a child process, which dies when the script ends, taking with it all of your changes of directory and non-exported variable definitions and shell functions, while sourcing keeps them.