On 1/5/15 3:14 PM, Poor Yorick wrote:
> In the following script, the effect of calling f0 is that the value global $i
> is still 5, but the effect of calling f1 is that the value of the global $i is
> 9.  It's nice to be able to create a function like unlocal that moves local
> variables out of the way, but I'm wondering if it can be relied on in future
> versions:

This is a consequence of bash's dynamic scoping and the idea that a local
variable should stay local if it's unset at the current scope.  I don't
have any plans to change that.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to