-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
原文:https://www.cnblogs.com/smallredness/p/11054882.html