zsh-workers
 help / color / mirror / code / Atom feed
* exec redirect prevents trap
@ 2016-04-16  7:59 frederik
  2016-04-16 16:34 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: frederik @ 2016-04-16  7:59 UTC (permalink / raw)
  To: zsh-workers

Dear Zsh Workers,

I have a script like this:

    #!/bin/zsh
    exec > >(tee -a /tmp/foo)
    trap "echo hi" INT TERM EXIT
    sleep 1d;

When I run it and hit ^C, it doesn't print anything. But when I remove
the "exec" line and do the same, it prints "hi". I would have expected
it to print "hi" both times.

- is this a bug?

- is there a way to get the trap to execute, even with the exec line
  present?

Thank you,

Frederick Eaton


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

end of thread, other threads:[~2016-04-16 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-16  7:59 exec redirect prevents trap frederik
2016-04-16 16:34 ` Bart Schaefer
2016-04-16 19:13   ` frederik

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