Linux shell 常用 加减乘除记录

  • + 运算

    count=0
    let count=count+2
    let count+=2
    echo $count
  • - 运算

    count=0
    let count=count-2
    let count-=2
    echo $count
  • 运算

    count=1
    let count=count*2
    let count*=2
    echo $count
  • / 运算

    count=8
    let count=count/2
    let count/=2
    echo $count
  • 取 余

    count=33
    let count=count%10
    let count%=2
    echo $count
posted @ 2018-04-08 18:15  陈富林  阅读(2230)  评论(0编辑  收藏  举报