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后面的条件表达式要放在[] 中 并且两边要有空格。

相关文章:

  • 2022-01-04
  • 2022-12-23
  • 2021-11-16
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案