Re: {ref}<&- does not work on array reference subscripts

2016-06-02 Thread Grisha Levit
I was thinking maybe some {get,set,unbind}_var_or_array_elem functions would help since there are a number of places that all need to handle this consistently. Could catch the case of using subscripts on array-reference-namerefs in such a function as well.

Re: {ref}<&- does not work on array reference subscripts

2016-06-02 Thread Chet Ramey
On 6/1/16 6:44 PM, Grisha Levit wrote: > Yikes, I missed the |exec| command in my example, that would certainly make > it confusing.. > > What I meant was that the assignment works (i.e. the nameref is followed > correctly), but the relevant code >

Re: {ref}<&- does not work on array reference subscripts

2016-06-01 Thread Grisha Levit
Yikes, I missed the exec command in my example, that would certainly make it confusing.. What I meant was that the assignment works (i.e. the nameref is followed correctly), but the relevant code doesn’t handle retrieving the v

Re: {ref}<&- does not work on array reference subscripts

2016-06-01 Thread Dan Douglas
You also noticed it runs in a subshell generally. Do you expect something different here? I think <&- should be consistent. On Wed, Jun 1, 2016 at 5:15 PM, Grisha Levit wrote: > declare -n ref=var[0] > {ref} {ref}<&- # fails

{ref}<&- does not work on array reference subscripts

2016-06-01 Thread Grisha Levit
declare -n ref=var[0] {ref}