Can a trap survive an exec /bin/sh?

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Tue Sep 17 07:06:30 AEST 1985


> Is there a way to get a trap to survive the exec of the shell?
> What I want to do is set a trap, exec a shell, continue on with
> an interactive session in the exec'ed shell, and have the trap
> turned on in the exec'ed shell.

Nope, any signal handler other than SIG_DFL or SIG_IGN is reset
to SIG_DFL by an exec.  You'll have to set up the signal handler
inside the exec'ed shell.



More information about the Comp.unix mailing list