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
On Mon, Aug 29, 2016 at 5:57 PM, Jarno Suni
wrote:
> declare -A a
> b="80's"
> ((++a[$b]))
> ((++a["$b"]))
> [[ $((++a[$b])) ]] || true
> [[ $((++a["$b"])) ]] || true # this finally works and makes the variable
> =1
> echo ${a["$b"]}
> echo ${a[$b]}
>
((++a[\$b]))
It's non-intuitive certainly,
Also, you can embed arguments, allowing for arbitrary execution:
$ env -i X='() { (a)=>\' bash -c 'echo curl -s https://bugzilla.redhat.com/';
head echo
bash: X: line 1: syntax error near unexpected token `='
bash: X: line 1: `'
bash: error importing function definition for `X'
http://www.w3.org/