From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Which signal >(process) receives after main shell exits?
Date: Fri, 11 May 2018 07:18:29 +0200 [thread overview]
Message-ID: <CAKc7PVDADSrAdtGawPUG51L4Kmh+9iJMN9EUK437aj0SoTKtKg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 501 bytes --]
Hello,
% fun() {
setopt localtraps
trap "echo waiting >> /tmp/reply; sleep 2; echo bye >> /tmp/reply; exit
1;" EXIT
echo "My PID: $sysparams[pid]"
repeat 1000; do
read -r -t 1 line
done
}
% exec {MYFD}> >(fun)
% exit
Above works – fun() will receive the trap, messages will appear in
/tmp/reply.
My question: can be "EXIT" replaced by some actual signal? I've tried PIPE,
HUP, INT, TERM and they didn't work.
--
Best regards,
Sebastian Gniazdowski
next reply other threads:[~2018-05-11 5:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-11 5:18 Sebastian Gniazdowski [this message]
2018-05-13 4:04 ` Sebastian Gniazdowski
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=CAKc7PVDADSrAdtGawPUG51L4Kmh+9iJMN9EUK437aj0SoTKtKg@mail.gmail.com \
--to=sgniazdowski@gmail.com \
--cc=zsh-users@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).