On 1/15/14, 10:04 PM, Carlos Pita wrote: > Bash Version: 4.2 > Patch Level: 45 > Release Status: release > > Description: > > When declaring a global associative array inside a function and > assigning a value to it at the same time, then the array is not > globally visible. This doesn't happen if I declare the array first and > then do the assignment. That is: > > Buggy?: > function f { > declare -gA a=([a]=2 [b]=4) > }
This is a bug in bash-4.2 that is fixed in bash-4.3. It looks like it was fixed back in November, 2012. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/