Skip to content
Prev 54478 / 63424 Next

Dialect for shell scripts

Same from here: in addition to what the standards say, it always pays to
be defensive and check "Portable Shell Programming" in the Autoconf
manual.  Among other things, this says

'$((EXPRESSION))'
     Arithmetic expansion is not portable as some shells (most notably
     Solaris 10 '/bin/sh') don't support it.

motivating the code shown below.  Perhaps simplest to always use expr.

-k