From f8af0b7ee44fed3f40e4c644f3cfa69468f2db12 Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Mon, 5 Nov 2007 02:56:15 +0000 Subject: Merge of 22992: make $? available on trap or hook shell exit. --- Doc/Zsh/builtins.yo | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Doc') diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 30d2cf84b..de5a96ea2 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -1198,6 +1198,8 @@ after each command. If var(sig) is tt(0) or tt(EXIT) and the tt(trap) statement is executed inside the body of a function, then the command var(arg) is executed after the function completes. +The value of tt($?) at the start of execution is the exit status of the +shell or the return status of the function exiting. If var(sig) is tt(0) or tt(EXIT) and the tt(trap) statement is not executed inside the body of a function, then the command var(arg) is executed when the shell terminates. -- cgit 1.4.1