.logout functionality using ksh <was: A few questions>

michael.s.balenger msb at cbnewsh.att.com
Sat Dec 22 08:09:39 AEST 1990


>>>>> On 21 Dec 90 15:38:49 GMT, ar at 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


----------------------------------------------------------------------
<cute quote>            Michael S. Balenger             (908) 949-8789
<cute disclaimer>       AT&T Bell Labs
M_Balenger at att.com      Room 1L-405
msb at hos1cad.att.com     Crawfords Corner Road
att!hos1cad!msb         Holmdel, NJ   07733-1988



More information about the Comp.unix.shell mailing list