Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Safe scripting
- X-seq: zsh-users 13732
- From: Richard Hartmann <richih.mailinglist@xxxxxxxxx>
- To: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- Subject: Re: Safe scripting
- Date: Wed, 21 Jan 2009 13:03:22 +0100
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=47hGk85eqbZy5KEvbLWChF9dasz88IcW5kAgGfK8KCM=; b=IO121XqgzHHhFOXEB7HZcBxkE/Vd9RY7C09bQ2zheuieXi1apZCSvzv4F57ONt4w9s h9I8RR1edxtUVXLtMkxu1unOQPRXp4xUfPpdi6/4/nPP4fa6zBOYGIxBNXG9UoYvBxpF E0E4wbUYPsszF6OOK1YBdeRCuVHHIz9ckUz/s=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Y9SJkG9ai41DBauzucGGau9ODaMHIUcmcm52ndYI3/WeFfvPgHe9T+RO2lzT4eNra7 SpWxgTv5fyocDAbq07ZBRxSQXY036JfQvk7k6hwCuRUH5Cud584WrPlokPVR+7gzOgxk Op+BYWyOar4fW+GtGCvpCF4azd7pmkeIeO6uM=
- In-reply-to: <gl6qnd$63s$1@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <gl6qnd$63s$1@xxxxxxxxxxxxx>
On Wed, Jan 21, 2009 at 10:43, Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx> wrote:
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
That is very basic and can be extended, for example with
cd foo || my_handler 'error foo' '10'
function my_handler() {
echo $1 $2
}
etc, etc.
Richard
Messages sorted by:
Reverse Date,
Date,
Thread,
Author