zsh-users
 help / color / mirror / code / Atom feed
* Which signal >(process) receives after main shell exits?
@ 2018-05-11  5:18 Sebastian Gniazdowski
  2018-05-13  4:04 ` Sebastian Gniazdowski
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Gniazdowski @ 2018-05-11  5:18 UTC (permalink / raw)
  To: Zsh Users

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-13  4:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11  5:18 Which signal >(process) receives after main shell exits? Sebastian Gniazdowski
2018-05-13  4:04 ` Sebastian Gniazdowski

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).