Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #13762

Re: Unset array doesn't work

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Unset array doesn't work
Date 2018-02-27 12:03 -0500
Message-ID <mailman.9814.1519751045.27995.bug-bash@gnu.org> (permalink)
References (3 earlier) <a642644f-e475-6361-140e-5b47ab4e321c@case.edu> <755d61fa-d2bc-8855-bc30-4388aff40691@gmail.com> <9974.1519637469@jinx.noi.kre.to> <10449.1519662864@jinx.noi.kre.to> <9508ce2b-a5dc-7446-4a3c-3e6e2566e1f0@case.edu>

Show all headers | View raw


On 2/27/18 11:23 AM, Chet Ramey wrote:
> On 2/26/18 11:34 AM, Robert Elz wrote:
> 
>> I believe that most shells that implement local (which is most shells) 
>> implement unset of a local as meaning the local var becomes unset,
>> not that it vanishes and the global reappears.
> 
> That was the objection: that unset in a function unset the local instance
> of the variable, and left the global instance in place.

And, as a followup, allowing `unset' in a function to remove an instance
of a variable in a previous scope, even if that scope was a function and
the variable was a local variable there, while still leaving any global
instance unchanged.

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

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Unset array doesn't work Chet Ramey <chet.ramey@case.edu> - 2018-02-27 12:03 -0500

csiph-web