echo "test set -x"
#set -x
#set -xv
alert()
{
if [ $1 -ne 0 ]; then
echo "this is warning, info: $2"
else
echo "this is success, info: $2"
fi
}
debug=1
read line
echo $line
test $debug -gt 0 && echo "this is debug mode"
read aa
echo $aa
aa=`echo $aa | tr [a-z] [A-Z]`
echo $aa
#if [ $aa = Y ]; then
if [ $aa = Y ]
then
echo "this is y"
alert $? "this is y"
else
echo "this is not y"
fi
shell编程之一---调试
最新推荐文章于 2021-04-02 14:15:00 发布