[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extglob and ()/{}
From: |
Greg Wooledge |
Subject: |
Re: extglob and ()/{} |
Date: |
Mon, 5 Apr 2021 21:39:24 -0400 |
On Mon, Apr 05, 2021 at 10:23:53PM -0300, Marco Ippolito wrote:
> Greg said it all:
>
> > extglob changes the way certain characters are parsed. It is necessary to
> > have a newline (not just a semicolon) between shopt -s extglob and any
> > subsequent commands to use it. You cannot enable extended globs inside a
> > group command that uses them, because the entire block is parsed before the
> > shopt is evaluated. Note that the typical function body is a group command.
> > An unpleasant workaround could be to use a subshell command list as the
> > function body.
For the record, I didn't write this paragraph, but it's a pretty
good one.
The current wording was finalized by "atlantic480" (I do not know
who that is):
https://mywiki.wooledge.org/glob?action=diff&rev2=35&rev1=34
Previous work on that paragraph was done by NeilMoore:
https://mywiki.wooledge.org/glob?action=diff&rev2=11&rev1=10
Along with various tweaks in between that I didn't take the time to
track down. The wiki is very much a group effort.