shell 运算符

由于shell 里面默认都是文本,所以不可以直接用加号来进行运算符操作。

方法1:

  count=1
  count=$(( count+1 ))

 

方法二:let (只有bash才能使用)

  count=1

  let "count=$count + 1"

 

 

  

 

posted @ 2021-11-08 15:11  蜜铀  阅读(28)  评论(0编辑  收藏  举报