From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1970 invoked from network); 24 Nov 2004 16:16:48 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Nov 2004 16:16:48 -0000 Received: (qmail 46206 invoked from network); 24 Nov 2004 16:16:42 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Nov 2004 16:16:42 -0000 Received: (qmail 25610 invoked by alias); 24 Nov 2004 16:15:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20581 Received: (qmail 25578 invoked from network); 24 Nov 2004 16:15:27 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Nov 2004 16:15:27 -0000 Received: (qmail 42358 invoked from network); 24 Nov 2004 16:14:39 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 24 Nov 2004 16:14:37 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Wed, 24 Nov 2004 16:13:26 +0000 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 24 Nov 2004 16:14:46 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.12.11/8.12.11) with ESMTP id iAOGEaBp008078 for ; Wed, 24 Nov 2004 16:14:36 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.12.11/8.12.11/Submit) with ESMTP id iAOGEanX008075 for ; Wed, 24 Nov 2004 16:14:36 GMT Message-Id: <200411241614.iAOGEanX008075@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: Zsh hackers list Subject: Re: =cmd cancels the whole code block In-reply-to: <20041124155833.GA4697@sc> References: <20041124155833.GA4697@sc> Date: Wed, 24 Nov 2004 16:14:36 +0000 From: Peter Stephenson X-OriginalArrivalTime: 24 Nov 2004 16:14:46.0342 (UTC) FILETIME=[B7038E60:01C4D240] 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 Stephane Chazelas wrote: > ~$ zsh -f > % a==a > zsh: a not found > % echo $? > 1 > % a==a || a==b > zsh: a not found > % a==a; echo $? > zsh: a not found > % (a==a); echo $? > zsh: a not found > 1 > % { > cursh> a==a > cursh> echo foo > cursh> echo bar > cursh> } > zsh: a not found > % > > should it be considered as a normal behavior? Yes, if the option NOMATCH is set, as it is by default. It is supposed to abort the entire sequence of commands, because it is designed to detect errors. > Revealed following a recent usenet thread in comp.unix.shell. > For one trying to do: > > { EDITOR==emacs || EDITOR==vi; } 2> /dev/null You have to turn it off and detect whether the expansion took place. setopt nonomatch EDITOR==emacs [[ $EDITOR = =* ]] || EDITOR==vi Or many possibly equivalents. The latest version of the shell allows you to do { EDITOR==emacs 2>/dev/null } always { TRY_BLOCK_ERROR=0 } || EDITOR==vi but it's hardly worth it in a case like this. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, 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 **********************************************************************