Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Possible signal handling issues



On Thu, 2 Jan 2014 22:40:31 +0000
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
>...
> TRAPINT() { set -x; kill -INT $$; }
>...
> I further note that if I run sleep 20 normally in the foreground
> (without the sleep in the trap) I get:
> 
> TRAPINT:0:> kill -INT 25339
> TRAPINT:0:> kill -INT 25339
> 
> exactly twice.

Just to finish off this train of thought:  I'm sure Bart remembers this,
but it's worth reminding home viewers that if TRAPINT returns status
0, which it usually will with then kill last, then the job controller assumes
the signal was already handled, so doesn't take any action to pass the
signal on to the job itself.  If I add "return 1" to the end of
TRAPINT() I only ever see the output once before the job ends.

I think I've now lost interest in this...

pws



Messages sorted by: Reverse Date, Date, Thread, Author