On Thu, Nov 14, 2013 at 8:26 AM, Mohan Gorai <[email protected]> wrote: > Hi , > > I'm using to ksh93 scripts in my application to do various jobs . while > using double associative arrays i found the below : > > # typeset -A foo > # typeset -A foo[bar] > # typeset -A foo[baz] > # foo[bar][cat]=1 > # foo[bar][dog]=2 > # foo[baz][mouse]=3 > # foo[baz][fish]=4 > # set | fgrep foo > _='foo[baz]' > foo=([bar]=([cat]=1 [dog]=2) [baz]=([0]='' [fish]=4 [mouse]=3) ) > > <<== foo[baz][0] is inserted unexpectedly > > Found that it's being fixed in alpha release as part of the below > > 12-08-20 A bug in which creating a two dimemsional associative array could > add an extra 0 element to the second subscript has been fixed. > > could someone help me the patch file so that i can patch my binary > accordingly .
ksh93 does not support multidimensional associative arrays. Only indexed multidimensional arrays are supported. If you wish to do the same for associative arrays just append the strings. The 12-08-20 issue you're referring to was a bug which tried to create multidimensional indexed arrays using string as index, which are equivalent to the arithmetic value 0 if they are not defined variables yet and set -o nounset was not set. Arguably the right fix here is that ksh93 should throw an error if someone tried to use an associative array with more than one dimension. Josh _______________________________________________ ast-developers mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-developers
