declare -A BASH_ALIASES='()' declare -A BASH_CMDS='()' declare -A fluff='()' declare -A BASH_ALIASES='()' declare -A BASH_CMDS='()' declare -A fluff='([bar]="two" [foo]="one" )' declare -A fluff='([bar]="two" [foo]="one" )' declare -A fluff='([bar]="two" )' declare -A fluff='([bar]="newval" [qux]="assigned" )' ./assoc.tests: line 26: chaff: four: must use subscript when assigning associative array declare -A BASH_ALIASES='()' declare -A BASH_CMDS='()' declare -Ai chaff='([one]="10" [zero]="5" )' declare -Ar waste='([version]="4.0-devel" [source]="./assoc.tests" [lineno]="28" [pid]="42134" )' declare -A wheat='([one]="a" [zero]="0" [two]="b" [three]="c" )' declare -A chaff='([one]="10" ["hello world"]="flip" [zero]="5" )' ./assoc.tests: line 38: unset: waste: cannot unset: readonly variable ./assoc.tests: line 39: chaff[*]: bad array subscript ./assoc.tests: line 40: [*]=12: invalid associative array key declare -A chaff='([one]="a" ["hello world"]="flip" )' flip argv[1] = argv[2] = argv[3] = argv[4] = argv[1] = argv[2] = argv[3] = argv[1] = argv[2] = argv[3] = argv[4] = argv[1] = ./assoc.tests: line 57: declare: chaff: cannot destroy array variables in this way ./assoc.tests: line 59: chaff[*]: bad array subscript ./assoc.tests: line 60: [*]=12: invalid associative array key declare -A wheat='([six]="6" ["foo bar"]="qux qix" )' argv[1] = argv[2] = argv[1] = declare -A wheat='([six]="6" ["foo bar"]="qux qix" )' argv[1] = <2> argv[1] = <7> argv[1] = argv[2] = argv[3] = argv[1] = argv[1] = <16> argv[1] = <16> argv[1] = argv[2] = <6> argv[1] = argv[2] = argv[3] = argv[1] = argv[2] = 8 /usr/local/bin . /bin /sbin /usr/sbin /usr/bin /bin /usr/ucb bin . bin sbin sbin bin bin ucb bin / / / / / / / / argv[1] = argv[1] = argv[1] = argv[1] = 8 /usr/local/bin . /bin /sbin /usr/sbin /usr/bin /bin /usr/ucb bin . bin sbin sbin bin bin ucb / / / / / / / 8 4 -- /bin ^usr^local^bin . ^bin ^sbin ^usr^sbin ^usr^bin ^bin ^usr^ucb ^usr^local^bin . ^bin ^sbin ^usr^sbin ^usr^bin ^bin ^usr^ucb \usr/local/bin . \bin \sbin \usr/sbin \usr/bin \bin \usr/ucb \usr\local\bin . \bin \sbin \usr\sbin \usr\bin \bin \usr\ucb \usr\local\bin . \bin \sbin \usr\sbin \usr\bin \bin \usr\ucb ([a]=1) qux foo /usr/local/bin/qux /usr/sbin/foo hits command 0 /sbin/blat 0 /usr/local/bin/qux 0 /bin/sh 0 /usr/sbin/foo blat qux sh foo /sbin/blat /usr/local/bin/qux /bin/sh /usr/sbin/foo foo qux argv[1] = argv[2] = argv[3] = <-l> alias blat='cd /blat ; echo $PWD' alias foo='/usr/sbin/foo' alias qux='/usr/local/bin/qux -l' alias sh='/bin/bash --login -o posix' sh foo blat qux argv[1] = argv[2] = argv[3] = argv[4] = outside: outside declare -A BASH_ALIASES='()' declare -A BASH_CMDS='()' declare -A afoo='([six]="six" ["foo bar"]="foo quux" )' argv[1] = argv[2] = argv[3] = outside 2: outside argv[1] = argv[1] = argv[2] = <> argv[3] = argv[4] = <> argv[1] = argv[1] = argv[2] = <> argv[3] = argv[4] = <> argv[1] = argv[1] = argv[2] = <> argv[3] = argv[4] = <> argv[1] = argv[1] = argv[2] = <> argv[3] = argv[4] = <> argv[1] = argv[1] = argv[2] = <> argv[3] = argv[4] = <> abc def def ./assoc5.sub: line 13: declare: `myarray[foo[bar]=bleh': not a valid identifier abc def bleh myarray=(["a]a"]="abc" ["]"]="def" ["a]=test1;#a"]="123" [foo]="bleh" ) 123 myarray=(["a]a"]="abc" ["a]=test2;#a"]="def" ["]"]="def" ["a]=test1;#a"]="123" [foo]="bleh" ) bar"bie doll declare -A foo='(["bar\"bie"]="doll" )' bar"bie doll declare -A foo='(["bar\"bie"]="doll" )' bar"bie doll declare -A foo='(["bar\"bie"]="doll" )' bar"bie doll declare -A foo='(["bar\"bie"]="doll" )' bar"bie doll declare -A foo='(["bar\"bie"]="doll" )' bar'bie doll declare -A foo='(["bar'\''bie"]="doll" )' bar'bie doll declare -A foo='(["bar'\''bie"]="doll" )' bar'bie doll declare -A foo='(["bar'\''bie"]="doll" )' bar'bie doll declare -A foo='(["bar'\''bie"]="doll" )' bar'bie doll declare -A foo='(["bar'\''bie"]="doll" )' bar$bie doll declare -A foo='(["bar\$bie"]="doll" )' bar[bie doll declare -A foo='(["bar[bie"]="doll" )' bar`bie doll declare -A foo='(["bar\`bie"]="doll" )' bar\]bie doll declare -A foo='(["bar\\]bie"]="doll" )' bar${foo}bie doll declare -A foo='(["bar\${foo}bie"]="doll" )'