Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Stopping functions breaking
- X-seq: zsh-users 6846
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx (Zsh users list)
- Subject: Re: Stopping functions breaking
- Date: Mon, 08 Dec 2003 12:52:18 +0000
- In-reply-to: "zzapper"'s message of "Mon, 08 Dec 2003 12:25:35 GMT." <kjq8tvsitfoc75dks27f5m73iggi04fkle@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
> 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 <pws@xxxxxxx> 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
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author