From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 881 invoked from network); 22 Sep 2004 15:37:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Sep 2004 15:37:19 -0000 Received: (qmail 36933 invoked from network); 22 Sep 2004 15:37:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Sep 2004 15:37:14 -0000 Received: (qmail 26238 invoked by alias); 22 Sep 2004 15:37:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20401 Received: (qmail 26223 invoked from network); 22 Sep 2004 15:37:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Sep 2004 15:37:10 -0000 Received: (qmail 36696 invoked from network); 22 Sep 2004 15:37:10 -0000 Received: from farley.org (HELO mail.farley.org) (67.64.95.201) by a.mx.sunsite.dk with SMTP; 22 Sep 2004 15:37:07 -0000 Received: from thor.farley.org (yvkeh7czrcfvf6yy@thor.farley.org [IPv6:2002:4340:5fcd:1::5]) by mail.farley.org (8.12.11/8.12.11) with ESMTP id i8MFb5MA036849 for ; Wed, 22 Sep 2004 10:37:05 -0500 (CDT) (envelope-from sean@farley.org) Received: from thor.farley.org (localhost [127.0.0.1]) by thor.farley.org (8.13.1/8.13.1) with ESMTP id i8MFb5RB063971 for ; Wed, 22 Sep 2004 10:37:05 -0500 (CDT) (envelope-from sean@farley.org) Received: from localhost (sean@localhost) by thor.farley.org (8.13.1/8.13.1/Submit) with ESMTP id i8MFb56g063968 for ; Wed, 22 Sep 2004 10:37:05 -0500 (CDT) (envelope-from sean@farley.org) X-Authentication-Warning: thor.farley.org: sean owned process doing -bs Date: Wed, 22 Sep 2004 10:37:05 -0500 (CDT) From: "Sean C. Farley" To: zsh-workers@sunsite.dk Subject: Re: PATCH: zsh-4.2.1: unset does not follow spec In-Reply-To: Message-ID: <20040922103029.D63284@thor.farley.org> References: <20040922091323.V45751@thor.farley.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Wed, 22 Sep 2004, Bart Schaefer wrote: > On Wed, 22 Sep 2004, Sean C. Farley wrote: > >> Recently, I read that FreeBSD's /bin/sh fails: >> http://www.freebsd.org/cgi/query-pr.cgi?pr=standards/45738 >> the IEEE Std 1003.1-2001: >> http://www.opengroup.org/onlinepubs/007904975/utilities/unset.html >> when it comes to the builtin unset. tcsh and bash do follow it. > > I don't see how zsh "fails" this specification. > > EXIT STATUS > > 0 > All name operands were successfully unset. > >0 > At least one name could not be unset. > > It appears to me that FreeBSD and Zsh are interpreting "could not be > unset" to include variables that were not set in the first place. > After all, if it isn't set, you can't UNset it, can you? It doesn't > say "0 if all name operands end up unset after this is finished, > regardless of their previous state" (which is how bash and tcsh appear > to interpret it). This is also in the spec: Unsetting a variable or function that was not previously set shall not be considered an error and does not cause the shell to abort. I assume non-zero is an error. > I'm going to ask about this on the austin-group list. It'll give them > something to discuss that they might actually come to agreement on. >>From your comment, it sounds like hell might freeze over first. :) I can see where both views are correct. Let me know when you hear back from them. Sean --------------- sean@farley.org