Bash Math
The purpose of this document is to ??? .
expr 1 + 1 2 myvar=$(expr 1 + 1) echo $myvar 2 expr $myvar + 1 3 Mac-n-Cheese:~ nicolas$ let myvar+=1 Mac-n-Cheese:~ nicolas$ echo $myvar 7 Mac-n-Cheese:~ nicolas$ let myvar+1 Mac-n-Cheese:~ nicolas$ echo $myvar 7 Mac-n-Cheese:~ nicolas$ let myvar2=myvar+1 Mac-n-Cheese:~ nicolas$ echo $myvar2 8 Mac-n-Cheese:~ nicolas$ echo $myvar 3 Mac-n-Cheese:~ nicolas$ echo $((myvar+2)) 5 Mac-n-Cheese:~ nicolas$ echo $[myvar+2] 5 Mac-n-Cheese:~ nicolas$ myvar=$((myvar+3)) Mac-n-Cheese:~ nicolas$ echo $myvar 3 Mac-n-Cheese:~ nicolas$ echo $((myvar++)) 3 Mac-n-Cheese:~ nicolas$ echo $myvar 4 Mac-n-Cheese:~ nicolas$ echo $((++myvar)) 5 Mac-n-Cheese:~ nicolas$ echo $myvar 5