- let
x=1
let "x+=1"
- (())
x=1
((x+=1))
- expr
x=1
x=`expr $x + 1`
- $[]
x=1
x=$[$x+1]
eg:
[root@localhost ~]# x=1;while true;do echo $x;((x++));sleep 1;done
1
2
3
4
x=1
let "x+=1"
x=1
((x+=1))
x=1
x=`expr $x + 1`
x=1
x=$[$x+1]
[root@localhost ~]# x=1;while true;do echo $x;((x++));sleep 1;done
1
2
3
4