Linux shell脚本调试

Linux大全评论891 views阅读模式

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

输出:
Linux shell脚本调试

企鹅博客
  • 本文由 发表于 2019年9月9日 02:31:57
  • 转载请务必保留本文链接:https://www.qieseo.com/226817.html

发表评论