source (command)
Appearance
![]() | It has been suggested that this article be merged with Dot (Unix). (Discuss) Proposed since December 2010. |
source is a Unix command that evaluates the file following the command, as a list of commands, executed in the current context.[1][2]
Frequently the "current context" is a terminal window into which the user is typing commands during an interactive session. The source command can be abbreviated as just a dot.
Some bash scripts should be run using the source your-script
syntax, e.g., if they contain a change directory (cd) command and the user intends that he be left in that directory after the script is complete, or the script file does not have the "execute" permission.
References
- ^ "BASH BUILTIN COMMANDS", the (GNU) Linux man page for "source" in Bash-3.0. 2004 Apr 20
- ^ Dot (Unix)