Path: csiph.com!feeder.erje.net!2.us.feeder.erje.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: Thu, 01 Mar 2018 05:38:31 +0700 Lines: 23 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> <15717.1519764581@jinx.noi.kre.to> <24248.1519844400@jinx.noi.kre.to> <20180228200051.ilzre3k4y7intd76@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1519857591 4902 208.118.235.17 (28 Feb 2018 22:39:51 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: 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:13779 Date: Wed, 28 Feb 2018 15:14:58 -0500 From: Chet Ramey Message-ID: | Yes, that's what I said. In the current scope, unset arranges for the | variable to appear unset. In a previous scope, unset just removes the | variable, which uncovers an instance of the variable at a (further) | previous scope. Were I you, I would simply change the "in a previous scope" behaviour to match the "in the current scope" behaviour. That makes it consistent, and rational. I cannot believe that there is anything anywhere which depends upon the current weirdness. I'd also forget "remove" as anything that unset is supposed to achieve, and I would change "appear" to "be" in the description of the current scope behaviour. kre