shell编程之一---调试

来源:互联网 发布:美工的岗位职责 编辑:程序博客网 时间:2024/04/30 03:51
echo  "test set -x"#set -x#set -xvalert(){if [ $1 -ne 0 ]; thenecho "this is warning, info: $2" elseecho "this is success, info: $2"fi} debug=1read lineecho $linetest $debug -gt 0 && echo "this is debug mode"read aaecho $aaaa=`echo $aa | tr [a-z] [A-Z]`echo $aa#if [ $aa = Y ]; thenif [ $aa = Y ]thenecho "this is y"alert $? "this is y"elseecho "this is not y"fi 

原创粉丝点击