1.在当前环境中执行shell脚本
source script.sh 或 . script.sh
2.在子shell中执行脚本(开启一个新的子进程运行)
使用绝对路径或相对路径来执行。例如/path/to/script.sh 或 …/script.sh
在当前目录下执行脚本./script.sh
1.在当前环境中执行shell脚本
source script.sh 或 . script.sh
2.在子shell中执行脚本(开启一个新的子进程运行)
使用绝对路径或相对路径来执行。例如/path/to/script.sh 或 …/script.sh
在当前目录下执行脚本./script.sh