Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: emulate (Re: Prompt fun)
- X-seq: zsh-workers 8166
- From: Zefram <zefram@xxxxxxxx>
- To: schaefer@xxxxxxxxxxxxxxxxxxxxxxx (Bart Schaefer)
- Subject: Re: PATCH: emulate (Re: Prompt fun)
- Date: Thu, 7 Oct 1999 16:50:24 +0100 (BST)
- Cc: zsh-workers@xxxxxxxxxxxxxx
- In-reply-to: <991007154217.ZM27101@xxxxxxxxxxxxxxxxxxxxxxx> from Bart Schaefer at "Oct 7, 1999 3:42:17 pm"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
>Hmm. I tend to think of it exactly the opposite way -- if I set errexit,
>I generally want it to continue to apply down through functions I call,
>because of exactly the circumstances you note -- scripts run from make,
>which uses -e when it invokes the shell.
Hmm. Surely in that case, the functions in question are going to be ones
written to be executed in the context of that particular script, and
will be intended to have ERR_EXIT set, and won't have an emulate line?
emulate will be used in functions intended to be used in many places,
and these functions should indicate errors by themselves returning with
a non-zero status, which will come under the purview of the caller's
ERR_EXIT setting. I've often written code like
# I don't care if foo doesn't exist, so ignore the return code
mv -f foo bar
which, if it were in a generic function, shoud have "emulate -L zsh",
and would be broken by ERR_EXIT being set unexpectedly.
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author