bash bug - expansion of env vars containing '?'

Michael ODonnell michael.odonnell at comcast.net
Mon Nov 10 15:31:26 EST 2003


kclark wrote:
> I guess that I'm going under the assumption that mod's shell isn't
> doing anything non-obvious with pathname expansion, nullglob
> is not set, GLOBIGNORE isn't set, etc.  I consider this to be
> extremely unlikely.

<blush>
Err, umm, that's kind of you but your confidence
is apparently misplaced, because on further
investigation it does appear that nullglob was
the key to the problem in my case.
</blush>

Dang!  - I was fully aware that nullglob could affect
the behavior in question and I was even aware that I
was setting it in my .bashrc - at certain points in
my experimentation I was taking the trouble to say

   unset nullglob

...and expecting that to disable the nullglob behavior
when, of course, that simple "unset" command won't do the
trick - at least not nowadays, and maybe not ever.

Some of my confusion (ignoring the part that's congenital
in origin) arose from the fact that, once upon a
time, many of bash's behaviors could be controlled via
setting/defining environment variables (such as nullglob)
using the "normal" variable manipulation commands like

   export someControlVariable=someValue

...and

   unset someControlVariable

...but I forgot that stuff was changed a while back to use
the "shopt" builtin command to control those behaviors
and it's no longer possible to manipulate many of those
"special" variables using those "normal" mechanisms for
variable manipulations.

What I should have been saying was

   shopt -u nullglob

...and then confirming the results by saying plain old

   shopt

Sorry for the noise...



More information about the gnhlug-discuss mailing list