[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Parameter expansion isn't performed first if it's in a parameter expansi
From: |
xuzhen |
Subject: |
Parameter expansion isn't performed first if it's in a parameter expansion |
Date: |
Sat, 26 Nov 2016 21:52:50 +0800 |
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 -fstack-protector-strong
-Wformat -Werror=format-security -Wall -no-pie
uname output: Linux ubuntu 4.8.10 #1 SMP PREEMPT Mon Nov 21 22:50:58
CST 2016 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 4.4
Patch Level: 5
Release Status: release
Description:
The manpage said that brace expansion is performed before any other
expansions. But I found it's not if it's in a parameter expansion.
Repeat-By:
$ unset a
$ echo ${a:{1..2}}
}
$ echo ${a:{1..2}
$ a=1234
$ echo ${a:{1..2}}
bash: a: {1..2: syntax error: operand expected (error token is "{1..2")
$ echo ${a:{1..2}
bash: a: {1..2: syntax error: operand expected (error token is "{1..2")
$ echo ${a:={1..2}}
1234}
- Parameter expansion isn't performed first if it's in a parameter expansion,
xuzhen <=