> If you apply that rule, you can figure out the answer: extglob changes the
> behavior of the parser, so it must be enabled before a command is parsed.
> The complete line of input is read before any of it is parsed, and the
> complete line is parsed before any of it is executed. As a consequence,
On 5/27/18 7:38 PM, marcelpa...@gmail.com wrote:
> Bash Version: 4.4
> Patch Level: 19
> Release Status: release
>
> Description:
> extglob patterns are not expanded in -c command-strings, even if extglob is
> set within the command-string. For instance, running:
>
> bash -c 'shopt -s extglob;
> bash -c 'shopt -s extglob; echo @(foo*|bar*)'
I've just discovered that this works as expected:
bash -O extglob -c 'echo @(foo*|bar*)'
However, the puzzle lingers on, since running this:
bash -c 'shopt -s extglob; shopt extglob'
results in:
extglob on
which indicates that the origi
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA