Re: nameref pointing to array element

2020-04-23 Thread Chet Ramey
On 4/22/20 6:05 PM, Daniel Molina wrote: > Hello, > > Is the following an intended behavior? Undefined? A bug? > > $ a[1]=2; declare -n ref=a[1]; echo $ref $((ref)) > 2 0 Thanks for the report. It looks like a bug, even though the rules for evaluating strings in the expression evaluator are slig

nameref pointing to array element

2020-04-22 Thread Daniel Molina
Hello, Is the following an intended behavior? Undefined? A bug? $ a[1]=2; declare -n ref=a[1]; echo $ref $((ref)) 2 0 Thanks, Daniel