Path: utzoo!attcan!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.unix.wizards Subject: Re: .logout for ksh? Keywords: .logout, KSH, help!!! Message-ID: <12299@steinmetz.ge.com> Date: 4 Oct 88 18:29:08 GMT References: <1594@mcgp1.UUCP> <209@dcs.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 28 In article <209@dcs.UUCP> wnp@dcs.UUCP (Wolf N. Paul) writes: | In article <1594@mcgp1.UUCP> fst@mcgp1.UUCP (Skip Tavakkolian) writes: | >Is there a way to execute something on exit, in Korn shell? | >This would be like the ``csh'' ``.logout'' file. | | I use a statement in /etc/profile to accomplish this: | | trap ". $HOME/.logout.ksh" 1 This is an excellent answer to the problem, but there is a way to make it more flexible. In my .profile I have code like this: for n in 0 1 3 15 do trap ". $HOME/.logout $n" $n done and my .logout starts with: TermSIG="$1" This allows me to make some tests in the logout script which avoid loops. When just doing a normal termination I ask if all terminals logged in under my ID are to be logged out, to allow me a fast way to end the day. Others will probably want to use other tests. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me