标签:show 相等 $1 exist 字符串 if判断 大于等于 判断目录 equal
-ne 不等于
-eq 等于
-gt 大于
-lt 小于
-ge 大于等于
-le 小于等于
if [ "$#" -ne 1 ];then
echo "no equal"
fi
if [ -f "file.txt" ];then
echo "file exist"
fi
if [ -d "fold" ];then
echo "fold exist"
fi
== 字符串相等
!= 字符串不相等
if [ "$1" == "-h" ];then
echo "show help"
fi
标签:show 相等 $1 exist 字符串 if判断 大于等于 判断目录 equal
原文地址:https://www.cnblogs.com/smallredness/p/11054882.html