Axel <[email protected]> writes:
> After your answer, I checked and I think the error message is not
> related to the variable name collision :
>
> [a...@axel-asus plugins]$ unset foo
> [a...@axel-asus plugins]$ func()
>> {
>> echo "[a]=5 [b]=10"
>> }
> [a...@axel-asus plugins]$ declare -A foo=( $(func) )
$ declare -A foo=('[a]=5')
bash: foo: [a]=5: must use subscript when assigning associative array
$ eval "declare -A foo=($(echo '[a]=5'))"; echo ${foo[a]}
5
Andreas.
--
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."