bash bug - expansion of env vars containing '?'

Michael ODonnell michael.odonnell at comcast.net
Sat Nov 8 10:51:37 EST 2003


I wrote:
>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:


Hmmm - hold the phone.  It appears that quoting
the string causes the desired expansion, so maybe
I'm wrong about this being a bug.  I can at least
say that the behavior is different from the 1.x and
earlier 2.x versions of bash, though.

######## shrapnel:~ 370---> a=LEFT
######## shrapnel:~ 371---> z=RIGHT
######## shrapnel:~ 372---> x='fu?bar'
######## shrapnel:~ 373---> echo "$a$x$z"
LEFTfu?barRIGHT


Maybe it's behavior that's been broken forever and
they only just got around to fixing it...



More information about the gnhlug-discuss mailing list