Following a discussion we had earlier this year regarding the order of
evaluation of variables and variable assignments:

 $ A="moo" B="$A more" env |grep ^B
 B=moo more

(rather than showing just 'B= more')
the dash maintainer has highlighted the following:


 $ bash -c 'K=dvb0.net0 A=${K#dvb} eval echo \$A'

 $ bash -c 'a=/bin PATH=$a ls /dev/null'
 bash: line 1: ls: No such file or directory
 $ bash -c 'x=${K:=dvb0.net0} A=${K#dvb} echo $A'

 $


which he says is inconsistent.  I could see the third one is correct
(variable assignments are evaluated after expansion, according to the
spec), but can't see whether the first two are correct or not.

Is the bash behaviour correct in these cases?

Cheers,
Kev.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to