Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Exception handling
- X-seq: zsh-users 8489
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx (Zsh users list)
- Subject: Re: Exception handling
- Date: Fri, 11 Feb 2005 18:51:25 +0000
- In-reply-to: <200502111445.j1BEj2Mp021524@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200502111445.j1BEj2Mp021524@xxxxxxxxxxxxxx>
On Feb 11, 2:45pm, Peter Stephenson wrote:
}
} I wrote the following test, with descriptions of what's going on. If
} it's interesting I can add bits to the archive.
It's interesting ... just two comments:
} # Raise an error, but don't show an error message.
} # This is a bit of a hack. (Surprised?)
} { ${*ERROR*} } 2>/dev/null
How about something a little neater, like { ${:?THROW} } instead? The
problem with relying on invalid syntax is that it might become valid
later. (Like "{ foo } always { bar }" did, for example.)
} # grrr.... if this is rerun, catch mustn't be an alias when we define
} # it as a function...
} unalias catch 2>/dev/null
If you used "function catch { ... }" you wouldn't need the unalias, but
if you need unalias you probably need "builtin unalias".
Messages sorted by:
Reverse Date,
Date,
Thread,
Author