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
不执行脚本,只是检查语法模式,将返回所有的语法错误
本文标题:shell脚本调试
本文链接:https://blog.quwenai.cn/post/7381.html
版权声明:本文不使用任何协议授权,您可以任何形式自由转载或使用。







还没有评论,来说两句吧...