> > It does not work as I expected. The running script was not terminated after
> > 5 seconds. So what's wrong here?
> 
> The shell is waiting for foreground process (sleep) to finish.  During
> this time no other process will be started by the shell.

Yes.  The trap is not taken until after the foreground process has completed.
If you run sleep in the background and use `wait', the signal will interrupt
it.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to