Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Safe scripting
- X-seq: zsh-users 13733
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Safe scripting
- Date: Wed, 21 Jan 2009 12:11:55 +0000
- In-reply-to: <2d460de70901210403o246f030ai6f11ba469fc4cca2@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <gl6qnd$63s$1@xxxxxxxxxxxxx> <2d460de70901210403o246f030ai6f11ba469fc4cca2@xxxxxxxxxxxxxx>
Richard Hartmann wrote:
> On Wed, Jan 21, 2009 at 10:43, Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx> wro
> te:
>
> Atom's solution is rather magic, but works very well. If you want to be
> portable, you can also do
>
> cd foo || exit 10
> rm bar || exit 11
> cd foobar || exit 12
> rm foobarbar || exit 13
"setopt errexit" should also be portable if done as "set -e".
If you just want to return from a function rather than exit a script,
"setopt errreturn", which is specific to zsh.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author