[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"$(echo "x'" '{1,2}')" performs brace expansion, even though it should n
From: |
Marco Elver |
Subject: |
"$(echo "x'" '{1,2}')" performs brace expansion, even though it should not |
Date: |
Mon, 14 Jan 2013 13:57:14 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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-unknown-linux-gnu'
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -march=x86-64
-mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4
-D_FORTIFY_SOURCE=2
-DDEFAULT_PATH_VALUE='/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin'
-DSTANDARD_UTILS_PATH='/usr/bin:/bin:/usr/sbin:/sbin'
-DSYS_BASHRC='/etc/bash.bashrc' -DSYS_BASH_LOGOUT='/etc/bash.bash_logout'
uname output: Linux laptop 3.6.11-1-ARCH #1 SMP PREEMPT Tue Dec 18 08:57:15 CET
2012 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu
Bash Version: 4.2
Patch Level: 42
Release Status: release
Description:
If a double-quoted command substitution command contains a
double-quoted string containing a single-quote, followed by a
single-quoted string containing a brace-expansion expression,
then the command to be substituted is not executed correctly.
See examples below.
Also tested with the following versions and produces the same behaviour:
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Repeat-By:
$ echo "$(echo "x" '{1,2}')" # Produces expected result
x {1,2}
$ echo "$(echo "x'" '{1,2}')" # Bug case: Add single-quote to first
string, causing brace-expansion!
x' 1 x' 2
$ echo $(echo "x'" '{1,2}') # Produces expected result, but unquoted!
x' {1,2}
- "$(echo "x'" '{1,2}')" performs brace expansion, even though it should not,
Marco Elver <=