From: Greg Wooledge
Subject: Re: GLOBIGNORE
Date: Sat, 2 May 2026 16:52:49 -0400
>On Sat, May 02, 2026 at 14:35:03 -0600, Stan Marsh wrote:
>> { 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.
>It does seem wrong.
Indeed. Thanks for the "eval" trick. That actually turns out to be
the best workaround in my actual use case.
BTW, maybe it is one of those things where the variable is "magic" and
the implementation is such that the magic happens as a side effect of
the variable being set. In the case where it is not explicitly set
by the current shell process (because it was inherited from the
environment), the magic doesn't happen.
=================================================================================
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.