Tag: Log off Log ash command specifies the link. COM Read environment variable
SOURCE command:
function of the source command: causes the shell to read into the specified shell program file and executes all the statements in the file sequentially
The source command is typically used to re-execute the initialization file you just modified to take effect immediately without having to log off and log back on.
Usage:
SOURCE filename or. FileName
The source command (from Shell C) is the built-in command of the bash shell, and the Point Command (.), which is a dot symbol (from the Bourne Shell), is another name for source.
What is the difference between the source filename and the sh filename and./filename execution script?
- When the shell script has executable permissions, there is no difference between using the SH filename and the./filename execution script.
- SH filename re-establishes a child shell, executes the statement inside the script in the child shell, which inherits the environment variables of the parent shell, but the new, changed variables of the child shell are not brought back to the parent shell unless export is used.
- SOURCE filename: This command actually simply reads the statements inside the script and executes them sequentially in the current shell, without creating a new child shell. Then all the new and changed statements in the script will be stored in the current shell.
Reference Link: The source command under Linux
Usage of source in Linux