Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: exit status



On Nov 10,  9:40am, Peter Stephenson wrote:
}
} A thread on the Austin group suggests the exit status of the shell
} should be available in exit traps.

I'm leaning towards Don Cragun's camp (the prior-to-this-patch zsh
behavior) on this one.  I think the answer (and a general issue about
the new hook functions, incidentally) is tied to the answer to this
other question:

What is the final exit status of the shell when the exit trap itself
calls exit?

If
	trap 'exit 42' EXIT; exit 1

returns 42 to the calling environment, then Korn and the GNU guys are
correct.  If it exits 1, then Don Cragun is correct.

Similarly, what happens if the zshexit hook calls exit?  What happens
if the zshexit hook calls "return 37"?



Messages sorted by: Reverse Date, Date, Thread, Author