tl;dr: thanks! no reply needed;
Thanks guys. I had a hard time accepting that this is how it's supposed
to work.
I accepted it now. :)
I just hope nobody is going to try to exploit it or something.
That segfault though:
set -x
declare -A ar
key='`echo -n "1">>times.txt`'
((++ar[$key])) # cmd i
Oh I see, I had no idea that's how it's meant to work. My apologies.
However this case still doesn't work, but maybe I should use single
quotes all the time?:
this fails(double quotes):
$ declare -A ar
$ idbad2="["
$ let "ar[$idbad2]+=11"
bash: let: ar[[]+=11: bad array subscript (error token
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/loc