Re: [patch] bashism in sh script



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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]