bash bug - expansion of env vars containing '?'

Michael ODonnell michael.odonnell at comcast.net
Sat Nov 8 23:53:39 EST 2003


> '?' is a shell metacharacter.
> You need to put it inside single quotes

I don't think so.  Given the example I supplied,
I'll claim that only double quotes will do the trick,
and that there's no way that single quotes can work,
because they also prevent the desired expansion of the
environment variable(s).  I'll give you a nickel if
you can make single quotes work as a general solution
to the problem illustrated in the example I gave,
i.e. this has to yield the expected results:

   echo $x

...when you don't have control over the definition
of x and where it can contain arbitrary characters.

As I said, that (no quotes) used to work in older
versions of bash, though I'd now agree that those
versions should probably be considered broken.

> or escape it with '\' if you're going
> to use it in the way you want.

I'll also give you a nickel if you can find a way to
make a backslash (or any other "escape" mechanism)
work (again, as a general solution) as illustrated
in the example I gave.     ;->



More information about the gnhlug-discuss mailing list