1.sh -x script
这将执行脚本并显示所有变量的值
如,脚本:
#!/bin/bash
#a test about shift
if [ $# -le 0 ]
then
echo "there is no parameters"
exit 0
fi
sum=0
while [ $# -gt 0 ]
do
sum=`expr $sum + $1`
shift
done
echo $sum
输出:
2.sh -n script
不执行脚本,只是检查语法模式,将返回所有的语法错误
转载于:https://www.cnblogs.com/qitian1/p/6461790.html
原文链接:https://blog.csdn.net/weixin_30342827/article/details/99526869
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。
还没有人抢沙发呢~