From: Martijn Dekker <martijn@inlv.org>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: 'exit' in trap handler does not execute EXIT trap
Date: Mon, 7 Nov 2016 18:18:47 +0000 [thread overview]
Message-ID: <4d3151fc-715b-dbe3-86fe-89a8d9fe5d75@inlv.org> (raw)
zsh does not execute the EXIT trap if the trap handler for another trap
exits the shell. I cannot find anything about this in the POSIX spec,
but this is different from all the other shells, which do execute the
EXIT trap.
Test script:
trap 'echo TERM; exit' TERM
trap 'echo EXIT' EXIT
kill -s TERM "$$"
echo 'FATAL: we should never get here!' 1>&2
exit 1
Actual output: TERM
Expected output: TERM\nEXIT
Thanks,
- M.
next reply other threads:[~2016-11-07 18:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20161107184855epcas2p40d3b5bf0dbe89e79bcc94c501a4d1562@epcas2p4.samsung.com>
2016-11-07 18:18 ` Martijn Dekker [this message]
2016-11-08 12:47 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d3151fc-715b-dbe3-86fe-89a8d9fe5d75@inlv.org \
--to=martijn@inlv.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).