shell 中的 if-elif-else 注意点
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后面的条件表达式要放在[] 中 并且两边要有空格。
邮箱: 1090055252@qq.com

浙公网安备 33010602011771号