Today I'd like to expand a bit more on the basic calculations in Unix scripts.
Use Parenthesis to simplify math expressions
In Basic Arithmetic Operations post I've shown you how expression evaluation can be used to calculate simple math expressions in your Unix shell:
ubuntu$ START=1 ubuntu$ FINISH=10 ubuntu$ ELAPSED=$(($FINISH - $START)) ubuntu$ echo $ELAPSED 9
[Read more…] about Another way to use math expressions in shell scripts