SOURCE Command usage:
SOURCE FileName
Function: Reads and executes the commands in the filename under the current bash environment.
Note: This command usually uses the command "." To replace.
such as: source. BASH_RC and. The. BASH_RC is equivalent (it can also be performed with./.BASH_RC if it has entered the directory).
Note: The difference between the source command and the shell scripts is that
Source executes the command in the current bash environment, and scripts starts a child shell to execute the command. This way, if the command to set the environment variable (or alias, etc.) is written into scripts, it will only affect the child shell and cannot change the current bash, so use the source command when setting the environment variable through the file (command column).
If the contents of the file Test.txt are
Pwd
Date
By executing the source test.txt or. Test.txt will be able to execute the command inside the batch to get the following content:
/home/zsm/tomcat/webapps
Thu 16:06:57 CST 2015
From this we can also think of how to implement the software boot
Linux source with. Command