From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11121 invoked from network); 8 Dec 2003 12:52:35 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Dec 2003 12:52:35 -0000 Received: (qmail 10054 invoked by alias); 8 Dec 2003 12:52:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6846 Received: (qmail 10039 invoked from network); 8 Dec 2003 12:52:21 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 8 Dec 2003 12:52:21 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 8 Dec 2003 12:52:21 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Mon, 8 Dec 2003 12:52:15 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 8 Dec 2003 12:53:48 +0000 To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: Stopping functions breaking In-reply-to: "zzapper"'s message of "Mon, 08 Dec 2003 12:25:35 GMT." Date: Mon, 08 Dec 2003 12:52:18 +0000 Message-ID: <25970.1070887938@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 08 Dec 2003 12:53:48.0048 (UTC) FILETIME=[524DE900:01C3BD8A] > I want it to cd to any directory beginning fred, if there 0 or more > than 1 matches I wish to carry on in the script. > > However whatever I try 0 or no matches breaks the script. Set the no_nomatch option, then the failed glob won't cause a fatal error. The cd will fail, but won't stop later things working. The best way to do this is probably to add setopt localoptions nonomatch at the top of the function. This will ensure the options are restored when the function exits. -- 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 **********************************************************************