On Sat, May 19, 2007 at 02:24:41PM +0200, Kevin F. Quinn wrote:
>
> Step 1 says that variable assignment words are saved for processing in
> steps 3 & 4, and step 2 performs expansion (including parameter
> expansion), excluding variable assignments. So in:
>
> x=${K:=dvb0.net0} A=${K#dvb} echo $A
Sorry, my mistake. I wanted say
bash -c 'x=${K:=dvb0.net0} A=${K#dvb}' env | grep ^A=
but that actually works. However, it is interesting to note that
bash -c 'K=dvb0.net0 A=${K#dvb}' env | grep ^A=
produces
A=
So I still stand by my statement that script writers on Linux cannot
safely rely on this construct.
As it is, we have two different behaviours, one given by the Korn shell
and another shared by most BSD-derived Bourne shells. I have not seen
any convincing evidence that either is not compliant with respect to
POSIX.
The behaviour of bash is closer to that of the Korn shell but is
different enough that this construct cannot be reliably used.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]