background preloader

Source (that "." operator)

Facebook Twitter

Source or dot operator Man Page. Read and execute commands from the argument in the current shell context.

source or dot operator Man Page

Syntax . [] source [] When a script is run using source it runs within the existing shell, any variables created or modified by the script will remain available after the script completes. In contrast if the script is run just as filename, then a separate subshell (with a completely separate set of variables) would be spawned to run the script. There is a subtle difference between executing a script by running .ss64script (dot ss64script) and . ss64script (dot space ss64script) the first is running a file thats been hidden from the 'ls' command, (although ls -a will show hidden files) the second option will execute ss64script even if it has not been set as an executable with chmod. Unless you provide an exact path to filename then bash will look first via the PATH variable and then in the current directory (only if filename is not found in $PATH.) Shell scripting - What is the difference between "source x", ". x" and "./x" in Bash?