> For example,
> 
> r=$((3 + 1))
> 
> And it doesn't matter this can be written in a
> different way so that
> it works in Solaris /bin/sh.  What matters is that
> /usr/xpg4/bin/sh 
> claims to be standard, and /bin/sh does not.

Funny thing, but I always believed tha r=$((3 +1)) notation is for Korn shell 
only.

As I recall, we were taught in school to use the following expression to do 
number arithmetic in Bourne shells:

r=3; r=`expr $r + 1`

Needless to say, the above method works in all Bourne-compatible shells.

I really don't understand why you would be willing to push your luck using Korn 
shell expressions in Bourne. It's like trying to make csh execute tcsh code, 
then finding the "correct" version of csh (in your case, /usr/xpg4/bin/sh), 
that had been extended to understand tcsh constructs.
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to