1,比较符号不能用 > < =
而要用
大于 -gt (greater than)
小于 -lt (less than)
大于或等于 -ge (greater than or equal)
小于或等于 -le (less than or equal)
不相等 -ne (not equal)
2,else 后面是没有then 的
3,if [ 'a' -gt 1 ];then if后面的条件表达式要放在[] 中 并且两边要有空格。
1,比较符号不能用 > < =
而要用
大于 -gt (greater than)
小于 -lt (less than)
大于或等于 -ge (greater than or equal)
小于或等于 -le (less than or equal)
不相等 -ne (not equal)
2,else 后面是没有then 的
3,if [ 'a' -gt 1 ];then if后面的条件表达式要放在[] 中 并且两边要有空格。
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。