From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24053 invoked from network); 4 Oct 2004 10:24:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Oct 2004 10:24:25 -0000 Received: (qmail 72315 invoked from network); 4 Oct 2004 10:24:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Oct 2004 10:24:18 -0000 Received: (qmail 246 invoked by alias); 4 Oct 2004 10:24:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20442 Received: (qmail 233 invoked from network); 4 Oct 2004 10:24:03 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Oct 2004 10:24:03 -0000 Received: (qmail 72007 invoked from network); 4 Oct 2004 10:24:03 -0000 Received: from lhuumrelay3.lnd.ops.eu.uu.net (62.189.58.19) by a.mx.sunsite.dk with SMTP; 4 Oct 2004 10:24:01 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i94AO0v03695 for ; Mon, 4 Oct 2004 10:24:00 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Mon, 4 Oct 2004 11:23:01 +0100 Received: from news01.csr.com ([192.168.143.38]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 4 Oct 2004 11:26:05 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.12.11/8.12.11) with ESMTP id i94ANwjS011728 for ; Mon, 4 Oct 2004 11:23:59 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.12.11/8.12.11/Submit) with ESMTP id i94ANvFc011725 for ; Mon, 4 Oct 2004 11:23:58 +0100 Message-Id: <200410041023.i94ANvFc011725@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: More POSIX developments In-reply-to: References: <200409271104.i8RB4URU009112@news01.csr.com> Date: Mon, 04 Oct 2004 11:23:57 +0100 From: Peter Stephenson X-OriginalArrivalTime: 04 Oct 2004 10:26:05.0983 (UTC) FILETIME=[8E70DAF0:01C4A9FC] 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 Bart Schaefer wrote: > Finally got a chance to look at this. > > On Mon, 27 Sep 2004, Peter Stephenson wrote: > > > The following patch, which I won't commit until we've decided which way > > to go, tries to cover the bases by making test work (more) like POSIX > > while leaving [[ ... ]] the way it is. The errors now return status 2 > > from evalcond, but for backward compatibility [[ ... ]] turns them into > > shell errors. > > I think this would be OK. Yes, the more I think about it the less likely it is that someone using "test" or "[" syntax wants anything other than standard-compliant behaviour. > > In other words, could I remove zwarnnamopt and make zwarnnam behave like > > that? > > I think that'd be safe, but I wouldn't object to a second opinion. I made the change and none of the tests failed. I think it's neater to do it like this and see if any problems turn up. Before I commit the patch, here's some proposed documentation. Index: Doc/Zsh/builtins.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v retrieving revision 1.70 diff -u -r1.70 builtins.yo --- Doc/Zsh/builtins.yo 30 Jun 2004 11:10:45 -0000 1.70 +++ Doc/Zsh/builtins.yo 4 Oct 2004 10:21:15 -0000 @@ -1124,6 +1124,11 @@ item(tt([) [ var(arg) ... ] tt(]))( Like the system version of tt(test). Added for compatibility; use conditional expressions instead (see noderef(Conditional Expressions)). +The main differences are: this command is not handled syntactically, so for +example an empty variable expansion may cause an argument to be omitted; +syntax errors cause status 2 to be returned instead of a shell error; and +arithmetic operators expect integer arguments rather than arithemetic +expressions. ) findex(times) cindex(shell, timing) -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************