shell 脚本执行lushuan 收录于 Shell 2020-04-19 约 154 字 预计阅读 1 分钟 目录 一、常见执行方式二、其它执行方式shell 脚本除了直接 ./test.sh 执行外,还可以用 sh 在子进程中执行、sh -x 打印执行过程便于调试、source 在父进程中执行,以及用 . 无需执行权限临时执行。一、常见执行方式1 ./test.sh 二、其它执行方式1 2 3 4 sh test.sh #在子进程中执行 sh -x test.sh #会在终端打印执行到命令,适合调试 source test.sh #test.sh在父进程中执行 . test.sh #不需要赋予执行权限,临时执行 Please enable JavaScript to view the comments powered by Gitalk.Please enable JavaScript to view the comments powered by Giscus.