Path: csiph.com!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!171.64.64.130.MISMATCH!usenet.stanford.edu!not-for-mail From: Robert Elz Newsgroups: gnu.bash.bug Subject: Re: Unset array doesn't work Date: Wed, 28 Feb 2018 03:49:41 +0700 Lines: 48 Approved: bug-bash@gnu.org Message-ID: References: <21679c48-4064-5683-2d5f-91bfb76687d0@case.edu> <790ade74-690f-541c-9ab4-6359917442d0@case.edu> <755d61fa-d2bc-8855-bc30-4388aff40691@gmail.com> <9974.1519637469@jinx.noi.kre.to> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1519786862 857 208.118.235.17 (28 Feb 2018 03:01:02 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: chet.ramey@case.edu Envelope-to: bug-bash@gnu.org In-Reply-To: <21679c48-4064-5683-2d5f-91bfb76687d0@case.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:3c8:9009:181::2 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:13763 Date: Tue, 27 Feb 2018 11:18:40 -0500 From: Chet Ramey Message-ID: <21679c48-4064-5683-2d5f-91bfb76687d0@case.edu> | It doesn't. Run the following script: OK, that looks good. But now I am very confused. | You'll see that the first expansion of `$var' uses the local value of IFS, | the second expansion uses the default value of $' \t\n', and the global | value doesn't change (or get unset) outside the function. Yes, and I was never expecting the global to be changed (that is, in this, I didn't imagine that as a possibility). | The objection was that the global or previous-scope value didn't get unset | when using the `unset' builtin; only in the local scope was it unset. I was in e-mail catchup mode, I am not sure I even saw the original, but I do tend to read your messages, and what you said (12 Feb) was ... | The visibility of a local variable is restricted to a function and its | children, That's fine. | and `unset' removes the currently-visible instance. as is that, at least if "removes" is interpreted in one way (which the script you sent suggests is correct). But: | Removing such an instance can `unconver' an instance in a previous scope. What's that? That;s not what the script shows happening, the global IFS was not "uncovered" (whatever that means). It was that sentence that caused my reply. Since it does not seem to mean what I thought it meant, perhaps you could say what it did mean? kre