shell 判断传入的变量是否为空 if [ X$1 = X ]

来源:互联网 发布:mac游戏不能全屏 编辑:程序博客网 时间:2024/06/09 16:58
……if [ X$1 = X ]    then      echo "the first argu is empty"    else      echo "the first argu is $1"fi……解释如下:如果X$1的值为X,则传入的变量为空。
0 0