BASH Tip: Alternative to expr for arithmetic | 2 Comments
Posted in Snippets on 30th August 2007, 11:59 am by Stuart
I discovered recently a neat way to do arithmetic in BASH without the need to use the expr command. There’s a build-in that uses the syntax $((…)) or $[ … ]. This is also faster as it avoids the need to invoke a separate command. See: http://snap.nlc.dcccd.edu for more on the rules pertaining to this syntax.
