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: Martijn Dekker Newsgroups: gnu.bash.bug Subject: Re: [BUG] 'unset' fails silently under specific conditions Date: Tue, 1 May 2018 23:27:26 +0100 Lines: 19 Approved: bug-bash@gnu.org Message-ID: References: <1295e1ea-73c0-e479-da03-b784ec975030@inlv.org> <59161dc5-bb33-d842-4af3-477e8784a4f5@inlv.org> <71d753dc-036f-7fd7-d703-408c3f8ac202@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1525213654 7557 208.118.235.17 (1 May 2018 22:27:34 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-Reply-To: <71d753dc-036f-7fd7-d703-408c3f8ac202@case.edu> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 37.59.109.123 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:14076 Op 01-05-18 om 19:36 schreef Chet Ramey: > OK, so which is it? Does an assignment statement preceding a special > builtin in a shell function create a local variable (as we discussed > just yesterday) Huh? That was about 'typeset'/'declare'. How is that relevant here? > or does it create a global variable because `Posix'? Yes. POSIX does not specify local variables at all, and even in a bash context I see nothing there to indicate that it should be local. The possibility that 'foo=bar :' might create a variable 'foo' that survives the ':' command, is exported, *and* is local to the function, hadn't occurred to me at all. POSIX is pretty strange sometimes but not *this* strange. - M.