First of all, I advise certain readers to read carefully before jumping to any
conclusions. Certain forum participants seem to have a problem of reading too
fast when
reading my posts.
Second, I *think* this is a bug, but I won't be too surprised to find that
there is some
clause somewhere in the man page or elsewhere that explains why it is not-a-bug.
Observe:
$ mkdir Sugar
$ cd Sugar
$ touch Foo_{0,1}{1..5}
$ ls -lsa
total 6
1 drwxr-xr-x 2 user group 1024 May 2 08:14 .
5 drwxr-xr-x 9 user root 5120 May 2 08:14 ..
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_01
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_02
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_03
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_04
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_05
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_11
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_12
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_13
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_14
0 -rw-r--r-- 1 user group 0 May 2 08:14 Foo_15
{ This next works as expected }
$ GLOBIGNORE='Foo_0*';echo Foo*
Foo_11 Foo_12 Foo_13 Foo_14 Foo_15
{ As does this }
$ unset GLOBIGNORE;echo Foo*
Foo_01 Foo_02 Foo_03 Foo_04 Foo_05 Foo_11 Foo_12 Foo_13 Foo_14 Foo_15
{ This fails to do what we want, but it is not unexpected }
$ GLOBIGNORE='Foo_0*' echo Foo*
Foo_01 Foo_02 Foo_03 Foo_04 Foo_05 Foo_11 Foo_12 Foo_13 Foo_14 Foo_15
{ But this one should work, but doesn't }
$ GLOBIGNORE='Foo_0*' bash5 -c 'echo "$GLOBIGNORE" "--->" Foo*'
Foo_0* ---> Foo_01 Foo_02 Foo_03 Foo_04 Foo_05 Foo_11 Foo_12 Foo_13 Foo_14
Foo_15
$
Now, each result is reasonable, except the last one.
In the last test, we set GLOBIGNORE in the environment of a new bash process,
and verify
that it is there (via the echo), but yet it still expands to match all the
files; the
value of GLOBIGNORE is ignored.
=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.
When responding to my posts, please try to refrain from giving bureaucratic
answers. If you have nothing useful to say, then just click Next and go on.
Note that certain posters (e.g., one with initials "GW") seem incapable
of posting non-bureaucratic answers to my posts. These posters should
definitely just click Next and move on.