Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14153

extglob patterns not expanded in -c command-strings

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From marcelpaulo@gmail.com
Newsgroups gnu.bash.bug
Subject extglob patterns not expanded in -c command-strings
Date Sun, 27 May 2018 20:38:24 -0300
Lines 36
Approved bug-bash@gnu.org
Message-ID <mailman.600.1527464312.1292.bug-bash@gnu.org> (permalink)
NNTP-Posting-Host lists.gnu.org
X-Trace usenet.stanford.edu 1527464312 13973 208.118.235.17 (27 May 2018 23:38:32 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org,bash@packages.debian.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:to:subject; bh=kerjmy1CR/fIp4Pa4ZyMi18AUzSiMtu8MPqKV8SXSiU=; b=jX1mcrpjEQe3G0CYt5aXphKJNlPxbtqi5s+cbxlaDZ+mJUZvxkmw1o7RVf+fbSE2Kb RLURBVIC+BFxna9e/BME3Ew/cg8jjDTtPGB1cd3GjkeLaTHl42BkF/dVUbIGWtj5rQhC 2wm+Sdj1EvR/FR+zXERNxL/waEwxMIa2/1Y0dPjgb5bAP5qtc3so5UyACfu1jFJHIgMG 4Qednwy+3411bxNHArUWs0kKjkZk6ZZRJF5BEjbdsDFOszprVX46fzB6RFfb7FHBJoFA ZRgYv04iycUaXXNM8mLilUiU479ds6nemqn3JteGMKOCgoEVxN1uhLtQKw+8IQsmsvfR y0lQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:to:subject; bh=kerjmy1CR/fIp4Pa4ZyMi18AUzSiMtu8MPqKV8SXSiU=; b=oC1zNN8EGBr65QmSNqGt2eAn4U7bkFnGGHoBjYBQ2jqW3IdFLcfj6RlPD1wC122+dw ZlvRiDYstrKDdBOU4lRuMDtW5gLF45csu2CNzfPTX7r/MfwazHabgFitZdwsy67JC0YX Xc7TUxy13KBlqq1fV2irBBXjeCxHygpXEyUZqqbFbF+YuP/vU0pm3k7xDdmfAgHzatkT KGKR/EX3dkZ8+6OPOv1Q5yYvqTdMbLciD6O2wPG3iCno6EJod1YTdtBN6Jgol+WEJBXm WLmRy8AdftX7ize1ErQF/Pmc9HIinzgz37jtbhG5T0UQIdwXOgpmiZxkYWLLVHcRHc3p LOcA==
X-Gm-Message-State ALKqPwfmWrvvMxVANR/hB5x/LXBf0kHREiukCJgRC3r2qHH0J35++HoT VUVakGwzZEWH3p8uJMTgMB0PxQ==
X-Google-Smtp-Source ADUXVKKLfdsh1WEVJLGWetei1Ai28mZDc1qegJ+QyzqHzwbDCdueLT6+SJL2vw9uqEO5Bje+RmwHkQ==
X-Received by 2002:a37:b0c:: with SMTP id 12-v6mr3066284qkl.386.1527464307874; Sun, 27 May 2018 16:38:27 -0700 (PDT)
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2607:f8b0:400d:c09::22d
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14153

Show key headers only | View raw


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' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib  -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/bash-vEMnMR/bash-4.4.18=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security
uname output: Linux monk 4.15.0-22-generic #24-Ubuntu SMP Wed May 16 12:15:17 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

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; echo @(foo*|bar*)'

generates this error:

bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `shopt -s extglob; echo @(foo*|bar*)'

Repeat-By:
In a clean directory, with no files, run:

bash -c 'shopt -s extglob; echo @(foo*|bar*)'

If the extglob pattern were recognized, as there's no file in the directory, the output should be:

@(foo*|bar*)

but instead, this error is generated:

bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `shopt -s extglob; echo @(foo*|bar*)'

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

extglob patterns not expanded in -c command-strings marcelpaulo@gmail.com - 2018-05-27 20:38 -0300

csiph-web