]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20110608 snapshot
authorChet Ramey <chet.ramey@case.edu>
Thu, 29 Dec 2011 18:09:08 +0000 (13:09 -0500)
committerChet Ramey <chet.ramey@case.edu>
Thu, 29 Dec 2011 18:09:08 +0000 (13:09 -0500)
MANIFEST
tests/RUN-ONE-TEST
tests/array.right
tests/array.tests
tests/array11.sub [new file with mode: 0644]

index e3817787c633173463c570e0cb4529b8f8d9c41c..ce0fb9311e3755ba01e1d09fdd2f887b737ad0e2 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -772,6 +772,7 @@ tests/array7.sub    f
 tests/array8.sub       f
 tests/array9.sub       f
 tests/array10.sub      f
+tests/array11.sub      f
 tests/array-at-star    f
 tests/array2.right     f
 tests/assoc.tests      f
index 72ec06a2c1fd8dde92acea5e8ac773e35f1d061b..3efcf32d68e9722024b6ca9d67f9e81b2aa5ac04 100755 (executable)
@@ -1,4 +1,4 @@
-BUILD_DIR=/usr/local/build/bash/bash-current
+BUILD_DIR=/usr/local/build/chet/bash/bash-current
 THIS_SH=$BUILD_DIR/bash
 PATH=$PATH:$BUILD_DIR
 
index 94c64a747dcb0159a1e2b1b19277a47824e9cd47..9df235fcd3f427d84dcb05b531ed102b0c145669 100644 (file)
@@ -341,3 +341,11 @@ ednesday
 onday
 uesday
 ednesday
+version[agent]
+version.agent
+version[agent]
+version.agent
+version[agent] foo[bar]
+version.agent bowl
+foobar] foo foo[bar]
+bleh bbb bleh
index 3b6996d369057fb55435ca74b20d5241b0426ef8..88d12e3a9b6a1e1e1b24c2feba69ce9c3b952176 100644 (file)
@@ -388,3 +388,5 @@ ${THIS_SH} ./array8.sub
 ${THIS_SH} ./array9.sub
 
 ${THIS_SH} ./array10.sub
+
+${THIS_SH} ./array11.sub
diff --git a/tests/array11.sub b/tests/array11.sub
new file mode 100644 (file)
index 0000000..87cf011
--- /dev/null
@@ -0,0 +1,29 @@
+# problems with associative array keys with ] and unbalanced [ ]
+# fixed after bash-4.2
+
+declare -A foo
+
+foo=(["version[agent]"]=version.agent)
+
+echo ${!foo[@]}
+echo ${foo[@]}
+
+unset foo
+declare -A foo
+foo["version[agent]"]=version.agent
+
+echo ${!foo[@]}
+echo ${foo[@]}
+
+declare foo["foo[bar]"]=bowl
+
+echo ${!foo[@]}
+echo ${foo[@]}
+
+declare -A array2["foo[bar]"]=bleh
+
+array2["foobar]"]=bleh
+array2["foo"]=bbb
+
+echo ${!array2[@]}
+echo ${array2[@]}