Path: utzoo!attcan!telly!lethe!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!think.com!snorkelwacker.mit.edu!bu.edu!att!cbnewsh!msb From: msb@cbnewsh.att.com (michael.s.balenger) Newsgroups: comp.unix.shell Subject: Re: .logout functionality using ksh Message-ID: <1990Dec21.210939.25607@cbnewsh.att.com> Date: 21 Dec 90 21:09:39 GMT References: <1990Dec11.202750.2435@wpi.WPI.EDU> <175@raysnec.UUCP> <144@mx-1> Reply-To: msb@hos1cad.ATT.COM (Mike Balenger) Organization: AT&T Bell Laboratories Lines: 29 In-Reply-To: ar@mcdd1's message of 21 Dec 90 15:38:49 GMT >>>>> On 21 Dec 90 15:38:49 GMT, ar@mcdd1 (Alastair Rae) said: ar> I get .logout in ksh by the following -- ar> alias exit='[ -f ~/.logout ] && . ~/.logout; exit' ar> ENV=$HOME/.kshrc ar> set -o ignoreeof ar> OK, so I have to type 'exit' to log off but I can still use ^D in ar> sub shells. I use the following. It works for ^D or "exit". #================================================================ # logout stuff #________________________________________________________________ if tty -s then trap ". $HOME/.logout; exit" EXIT else trap ". $HOME/.logout >/dev/null 2>&1; exit" EXIT fi ---------------------------------------------------------------------- Michael S. Balenger (908) 949-8789 AT&T Bell Labs M_Balenger@att.com Room 1L-405 msb@hos1cad.att.com Crawfords Corner Road att!hos1cad!msb Holmdel, NJ 07733-1988