bash arithmetic
From thelinuxwiki
using let
let "TOTAL = ( $A + 5 ) / $b"
floating point using bc
TOTAL=`echo "( $A + 5 ) / $b" | bc -l
using scale to control number of digits
$ echo "1 / 100" | bc -l .01000000000000000000 $ echo "scale =2; 1 / 100" | bc -l ~ .01
using expr
a=`expr $a + 1`
a=`expr 5 + 3`