[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Global variable modification by nameref chain
From: |
Chet Ramey |
Subject: |
Re: Global variable modification by nameref chain |
Date: |
Fri, 6 May 2016 09:17:59 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.0 |
On 4/27/16 9:05 AM, Grisha Levit wrote:
> Is the behavior below expected? In the presence of a local $var, the
> /global/ $var can be modified by assigning a value to a local nameref that
> points to a global nameref that points to $var. However, the local nameref
> expands to the /local/ value of $var.
Yes, that's how it works. The nameref resolution search doesn't re-start
back at the original context. It's like a symbolic link -- it continues
at the same context as the resolved nameref.
I don't have any plans to change this before bash-4.4.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- Re: Global variable modification by nameref chain,
Chet Ramey <=