首页 / 操作系统 / Linux / Linux shell脚本调试
1.sh -x script
这将执行脚本并显示所有变量的值
如,脚本:#!/bin/bash#a test about shiftif [ $# -le 0 ]thenecho "there is no parameters"exit 0fisum=0while [ $# -gt 0 ]dosum=`expr $sum + $1`shiftdoneecho $sum输出:
2.sh -n script
不执行脚本,只是检查语法模式,将返回所有的语法错误本文永久更新链接地址