> Machine Type: i386-unknown-openbsd4.4
>
> Bash Version: 4.0
> Patch Level: 0
>
> Description:
> playing with the associative arrays, bash ends up in what appears
> to be a busy loop that I cannot interupt with C-c
>
> Repeat-By:
>
>
> bash-4.0$ declare -A array
> bash-4.0$ declare array["foo[bar"]=bleh
> bash-4.0$ array["foo"]=bleh
You tricked the shell. Bash isn't smart enough to realize you're assigning
to an associative array, and performs quote removal on the assignment
before running `declare'.
What ends up happening is that the shell tries to create a variable named
'array[foo[bar]=bleh', since the dequoted word is no longer a valid
assignment statement. This leads to all sorts of weird behavior, since
some of the code's assumptions are violated.
The attached patch should catch the attempts to create invalid variables
and flag them as errors.
Chet