[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is this the expected behaviour for nameref in Bash 4.4 now?
From: |
Chet Ramey |
Subject: |
Re: Is this the expected behaviour for nameref in Bash 4.4 now? |
Date: |
Fri, 28 Oct 2016 10:01:15 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 10/20/16 7:44 PM, Jack Kuan wrote:
> Thanks for replying.
>
> I was expecting that in the second iteration of the loop, the
> local var=var_123 command would make var a normal variable again with
> value "var_123"
This is the bad assumption. You didn't unset `var' before doing this, so
it retains its local attribute and its nameref attribute. Trying to make
a local variable from an already-local variable is a no-op.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/