shell程序如何运行和调试?

来源:百度知道 编辑:UC知道 时间:2024/05/28 14:07:30

1,可以 sh test.sh 来运行;
可以赋予这个文件以可执行权限后运行:
chmod u+x test.sh
./test.sh

调试,在必要的地方添加如 echo 的输出语句来判断即可。

bash -n shellFile.sh
bash -v shellFile.sh
bash -x shellFile.sh