For example:

declare -A foo
foo['ab]']=bar

will work perfectly fine, but:

declare -A foo
foo=( ['ab]']=bar )

will end with following error:

-bash: [ab]]=bar: bad array subscript

Same with double quotes, or backslash quoting. It's still possible to 
quote that right bracket with backslash inside single quotes, but while
it will do the assignment without errors, the key will be different.

There's no mention in documentation about () specific constraints, 
so it looks like a small bug.

Tested with:

BASH_VERSINFO=([0]="4" [1]="2" [2]="10" [3]="2" [4]="release" 
[5]="i686-pc-linux-gnu")
BASH_VERSION='4.2.10(2)-release'


p.s.
keep me in CC, as I'm not subscribed

Reply via email to