Running a script the first way runs it as a child process. Sourcing (the second way), on the other wayhand, runs the script as if you entered all its commands into the current shell - if the script sets a variable, it will remain set, if the script exits, your session will exit. See help . for documentation.