Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.shell Subject: Re: .logout functionality using ksh Message-ID: <2628@sixhub.UUCP> Date: 13 Dec 90 15:38:14 GMT References: <1990Dec11.202750.2435@wpi.WPI.EDU> <175@raysnec.UUCP> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 24 In article <175@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes: | The approach I've used successfully involves trapping the logout | signal (signal 0). Example: | | trap 'tput clear; exit' EXIT I use ksh, but the technique is the same, mostly. Since I want to catch ALL catchable signals, and may want to take action on them in the logout, my setup looks like this. for n in 0 1 3 15; do trap "$HOME/.logout $n" $n done The .logout ends with an exit, and I can take special action on various signals if I wish. Since I may be in on many virtual terminals and run SysV variants on most machines, I leave with "kill -1 -1" to kill all processes in the system owned by me. Ugly but effective. -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me