On 12/9/18 1:30 AM, Grisha Levit wrote:
> When a variable is present in the temporary environment and then declared
> local in a function, it seems to not actually make a local variable, in the
> sense that the variable does not show up in the output of `local',
> unsetting
> the variable reveals the variable from the higher scope rather than marking
> it invisible, etc.
> 
>     $ f() { local v=x; local -p; }; v=t f
> 
>     $ f() { local v; declare -p v; }; v=t f
>     declare -x v="t"
> 
>     $ f() { local v=x; unset v; declare -p v; }; v=g; v=t f
>     declare -- v="g"
> 
> Is this intentional?

It's a cosmetic issue. The variables behave the same even if they're not
flagged as local. I'll fix it for the next release.

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

Reply via email to