[comp.unix.wizards] should /bin/sh exec trigger a trap 0?

dave@lsuc.uucp (David Sherman) (03/02/88)

Question of policy here: suppose you have
	trap 'foo bar' 0
in your .profile, meaning that this should be done when your
shell exits.  Now suppose your shell doesn't exit normally, but
it taken out through an exec, e.g.
	exec /bin/login		( == login)
or	exec who		(I want to see who's on, then sign off)

Should exec trigger the trap?  And, for that matter, sh built-ins
which do exec, such as login?

I realize this isn't the case now (at least in v7 sh, and I suspect
in all of them), but I wonder what others think.  My feeling is that if
the shell is going away, it should do what it was told to do when it
goes away.

David Sherman
Toronto
-- 
{ uunet!mnetor  pyramid!utai  decvax!utcsri  ihnp4!utzoo } !lsuc!dave