[patch] bashism in sh script

Pavel Roskin proski at gnu.org
Fri Aug 8 07:45:11 UTC 2003


On Fri, 1 Aug 2003, GoTaR wrote:

> There's no thing like $[..] to evaluate expressions in POSIX sh, it's
> bash feature. sh uses $((..)) instead (and bash understands it too).
> Here comes fix.

Does the next line work for you?  I mean this:

    if (( $A < 10 )); then A="0$A"; fi

I think it's a much worse case of non-portable code.  Have you tested your
changes?

-- 
Regards,
Pavel Roskin




More information about the mc-devel mailing list