bash bug - expansion of env vars containing '?'

Michael ODonnell michael.odonnell at comcast.net
Sat Nov 8 10:39:09 EST 2003


Some people on this channel might find it to be of
morbid interest that the most recent version of bash
apparently has a bug (that I have already reported)
in the handling of '?' characters in the expansion of
environment variables.  In the log below you can see
that any env var (or combination thereof) with a '?'
character in it results in an empty string when expanded:


######## shrapnel:~ 70---> echo $BASH_VERSION                
2.05b.0(1)-release
######## shrapnel:~ 71---> a='LEFT'
######## shrapnel:~ 72---> echo $a
LEFT
######## shrapnel:~ 73---> z='RIGHT'
######## shrapnel:~ 74---> echo $z
RIGHT
######## shrapnel:~ 75---> x='fubar'
######## shrapnel:~ 76---> echo $x
fubar
######## shrapnel:~ 77---> echo $a$x$z
LEFTfubarRIGHT
######## shrapnel:~ 78---> x='fub?ar'
######## shrapnel:~ 79---> echo $x

######## shrapnel:~ 80---> echo $a$x$z

######## shrapnel:~ 81---> echo $a$z
LEFTRIGHT
######## shrapnel:~ 82---> x='fubar'
######## shrapnel:~ 83---> echo $x
fubar
######## shrapnel:~ 84---> echo $a$x$z
LEFTfubarRIGHT




More information about the gnhlug-discuss mailing list