From 254b3f1a6b85e6cfefe21fea3d81c3f97c003ec2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 10 Nov 2006 09:59:26 +0000 Subject: 22992: make $? available in exit traps/hooks 22993: slightly more effective _make variable fix --- Doc/Zsh/builtins.yo | 2 ++ Doc/Zsh/func.yo | 2 ++ 2 files changed, 4 insertions(+) (limited to 'Doc/Zsh') diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 820888ac3..27f91e8b6 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -1252,6 +1252,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. diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo index 74d031fd1..16a838f9d 100644 --- a/Doc/Zsh/func.yo +++ b/Doc/Zsh/func.yo @@ -248,6 +248,8 @@ findex(TRAPEXIT) item(tt(TRAPEXIT))( Executed when the shell exits, or when the current function exits if defined inside a function. +The value of tt($?) at the start of execution is the exit status of the +shell or the return status of the function exiting. ) findex(TRAPZERR) findex(TRAPERR) -- cgit 1.4.1