On 8/29/14, 11:45 AM, Jason Vas Dias wrote:
> Nor does the error happen if indirect expansion is not used:
Just to head off a potential question. This is not the same as the first
example, since my_array is declared as an associative array.
> $ ( function f() { local an_array=$1; local value='1.0';
> local v=$value;
> local ev='['"'"'value'"'"']='"'""$v""'";
> eval ${an_array}='('"$ev"')'; }; declare -A my_array; set -x; f my_array
> )
^^^^^^^^^^^^^^^^^^^
|||||||||||||||||||
> + f my_array
> + local an_array=my_array
> + local value=1.0
> + local v=1.0
> + local 'ev=['\''value'\'']='\''1.0'\'''
> + eval 'my_array=(['\''value'\'']='\''1.0'\'')'
> ++ my_array=(['value']='1.0')
> $
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/