Re: "unset var" pops var off variable stack instead of unsetting it
From:
Stephane Chazelas
Subject:
Re: "unset var" pops var off variable stack instead of unsetting it
Date:
Mon, 20 Mar 2017 13:10:23 +0000
User-agent:
Mutt/1.5.24 (2015-08-30)
2017-03-20 08:04:33 -0400, Greg Wooledge:
[...]
> > Credits to Dan Douglas
> > (https://www.mail-archive.com/miros-mksh@mirbsd.org/msg00707.html)
> > for finding the bug. He did find a use for it though (get the
> > value of a variable from the caller's scope).
>
> Isn't this exactly the same as the "upvar" trick that Freddy Vulto
> discovered? http://www.fvue.nl/wiki/Bash:_Passing_variables_by_reference
Hi Greg,
Yes, I hadn't realised initially that the issue had already been
discussed before (and not fixed). You'll find that that "upvar"
and the link above has since been mentioned in this thread
(see also https://www.mail-archive.com/bug-bash@gnu.org/msg19445.html)
At this point, I have little hope that bash will be fixed. But
mksh/oksh and yash still might.
--
Stephane