On Sun, May 20, 2007 at 01:11:02PM +0200, Kevin F. Quinn wrote:
>
> (I think you meant:
>
> bash -c 'x=${K:=dvb0.net0} A=${K#dvb} env' | grep ^A=
> bash -c 'K=dvb0.net0 A=${K#dvb} env' | grep ^A=
> )
Yep.
> Although that second fails when written like that (bash 3.2.15(1)), it
> does work interactively and in a script, so that's a bug in the bash
> command line processing, I'd guess.
>
> ----
> #!/bin/bash
> unset A K
> K=dvb0.net0 A=${K#dvb} eval echo \$A
> unset A K
> x=${K:=dvb0.net0} A=${K#dvb} echo $A
> unset A K
> K=dvb0.net0 A=${K#dvb} env | grep ^A=
> unset A K
> x=${K:=dvb0.net0} A=${K#dvb} env | grep ^A=
> ----
Actually this is different. Note that you're using a pipeline here
while I didn't have a pipeline within bash. Indeed if you put the
pipeline inside bash then it works on the command line too:
bash -c 'K=dvb0.net0 A=${K#dvb} env | grep ^A='
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]