On Wed, Feb 15, 2023 at 02:29:29PM +0100, Tobias Powalowski via Bug reports for 
the GNU Bourne Again SHell wrote:

I once had that same issue:
https://lists.gnu.org/archive/html/bug-bash/2015-10/msg00013.html

Conclusion: the shopt is not yet working until the function has been run.
(or after the line has been parsed).

> ,,,
> % bash <<'EOF'
> 
> function x() {shopt -s extglobmapfile -t packages < <(printf "%s\n"
> "dir"/"dir"/"dir"/"{targetname}"-"${targetver}"-"${targetarch}".pkg.tar?(.!(sig|.*)))shopt
> -u extglob}xEOFResults in:
> 
> bash: line 3: syntax error near unexpected token `('
> 
> bash: line 3: `mapfile -t packages < <(printf "%s\n"
> "dir"/"dir"/"dir"/"{targetname}"-"${targetver}"-"${targetarch}".pkg.tar?(.!(sig|.*)))'
> 
> Putting shopt options outside the function, but is this the wanted
> behaviour?
> ...
> Tobias Powalowski

-- 
Regards, Mike Jonkmans

  • Bash 5.2 ... Tobias Powalowski via Bug reports for the GNU Bourne Again SHell

Reply via email to