Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
exec redirect prevents trap
- X-seq: zsh-workers 38290
- From: frederik@xxxxxxx
- To: zsh-workers@xxxxxxx
- Subject: exec redirect prevents trap
- Date: Sat, 16 Apr 2016 00:59:41 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Reply-to: frederik@xxxxxxx
- Sender: <frederik@xxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author