From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14794 invoked from network); 4 Apr 2003 16:30:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Apr 2003 16:30:39 -0000 Received: (qmail 19967 invoked by alias); 4 Apr 2003 16:30:12 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6012 Received: (qmail 19957 invoked from network); 4 Apr 2003 16:30:11 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 4 Apr 2003 16:30:11 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 4 Apr 2003 16:30:11 -0000 Received: (qmail 27592 invoked from network); 4 Apr 2003 16:30:08 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-16.tower-1.messagelabs.com with SMTP; 4 Apr 2003 16:30:08 -0000 Received: from gmcs3.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id RAA16343; Fri, 4 Apr 2003 17:30:08 +0100 X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.61] claimed to be gmcs3.logica.co.uk Received: from gmcs3.logica.co.uk (localhost [127.0.0.1]) by gmcs3.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h34GTeb29900; Fri, 4 Apr 2003 18:29:40 +0200 X-VirusChecked: Checked In-reply-to: <18642.1049472589@csr.com> From: Oliver Kiddle References: <18642.1049472589@csr.com> To: Peter Stephenson cc: zsh-users@sunsite.dk Subject: Re: Unsetting a variable that was not previously set Date: Fri, 04 Apr 2003 18:29:40 +0200 Message-ID: <29898.1049473780@gmcs3.logica.co.uk> Peter wrote: > Vincent Lefevre wrote: > > zsh should return an exit status 0 when unsetting a variable that was > > not previously set. > > > > See > > http://www.opengroup.org/onlinepubs/007904975/utilities/unset.html > > I think you're probably right, but it's not completely clear. The page > you quote explicitly says: I queried Chet about this when it was changed in bash (about a year ago) and got this response: I got a bug report or two, and decided that the new behavior is what POSIX.2 intended. It seems to be what sh has always done. It's still open to debate, though. I can be convinced otherwise. I never made up my mind to do anything in part because ksh93 does the same as zsh but it is probably right. Also, at the moment, it seems that for an readonly variable, it is returning 0 which is clearly wrong. > Now, if it doesn't exist, it can't be unset, but I think by `unset' they > mean `rendered such that it is not set whether or not it was before', > which is your interpretation. It seems a fair interpretation. Perhaps could be wise to have it clarified though. Oliver