In Linux and Unix, the source
command is used to execute commands from a script or configuration file in the current shell. The source
command reads the file specified as an argument and executes the commands in the file as if they were typed at the command prompt.
Here are some examples of using the source
command:
source /path/to/script.shoSurce:www.lautturi.com
This will execute the commands in the script file script.sh
in the current shell.
source /path/to/config.cfg
This will execute the commands in the configuration file config.cfg
in the current shell.
source
command multiple times:source /path/to/script1.sh source /path/to/script2.sh source /path/to/config1.cfg source /path/to/config2.cfg
This will execute the commands in the specified scripts and configuration files in the current shell, in the order they are listed.
The source
command is often used to execute configuration files or environment setup.