……
if [ X$1 = X ]
then
echo "the first argu is empty"
else
echo "the first argu is $1"
fi
……
解释如下:
如果X$1的值为X,则传入的变量为空。
shell 判断传入的变量是否为空 if [ X$1 = X ]
最新推荐文章于 2024-06-21 08:25:56 发布
……
if [ X$1 = X ]
then
echo "the first argu is empty"
else
echo "the first argu is $1"
fi
……
解释如下:
如果X$1的值为X,则传入的变量为空。