First page Back Continue Last page Graphics
More Arithmetic
You may also do arithmetic in array subscripts (arrays come later), so that these examples all have the same effect on declare -i x=3
- let x+=1
- let "x = x + 1"
- (( x += 1 ))
- echo $[ x = x + 1 ]
- echo $(( x += 1 ))
- array[x++]="value"
In each case, echo $x will print the result 4