Article Directory
Linux command-program start
source
definition
The source command (from the C Shell) is a built-in command of the bash shell. The dot command is a dot symbol (from the Bourne Shell) which is another name for source.
usage
source 文件名
. 文件名 # 注意 "." 和文件名之间有空格
The file does not need to have **"Permission"** to be executed.
Features
In 当前
reading and FileName in the shell command execution process will not start a new child process. All variables set in the script will become part of the current Shell.
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-heoeXMaU-1590413492945)(source%20sh.assets/20181116115144343.png)]
sh
usage
sh 文件名
The file does not need to have **"Permission"** to be executed.
Features
In 当前
the new process under a shell 子进程
, execute the script inside the statement in the sub-shell, the shell sub- 继承
parent shell environment variables, but the new sub-shell, change variables 不会被带回父
shell, unless export.
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-Oz2Y64wY-1590413492947)(source%20sh.assets/20181116114136359.png)]
./
usage
./ 文件名
The file needs **"Permission"** to be executable.
Features
Same as sh command.
references
https://blog.csdn.net/violet_echo_0908/article/details/52056071 Detailed explanation of source command and the difference between source sh ./
https://www.cnblogs.com/pcat/p/5467188.html source sh ./ The difference between
https://blog.csdn.net/steve_hao/article/details/84108014 source ./ Difference-Picture