shwake@raysnec.UUCP (Ray Shwake) (12/12/90)
fenn@wpi.WPI.EDU (Brian Fennell) writes: >There was a question about .logout for bash... any idea how to fudge >it with ksh? The approach I've used successfully involves trapping the logout signal (signal 0). Example: trap 'tput clear; exit' EXIT I use this under SCO and ISC UNIX, among others. On some systems, the EXIT reference is not recognized, so use 0 instead.
davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (12/13/90)
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
wnp@iiasa.ac.at (Wolf PAUL ) (12/14/90)
In article <175@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes: )fenn@wpi.WPI.EDU (Brian Fennell) writes: ) )>There was a question about .logout for bash... any idea how to fudge )>it with ksh? ) ) The approach I've used successfully involves trapping the logout )signal (signal 0). Example: ) ) trap 'tput clear; exit' EXIT ) ) I use this under SCO and ISC UNIX, among others. On some systems, )the EXIT reference is not recognized, so use 0 instead. Or to simulate .logout completely, do something like trap ". $HOME/.logout ; exit" EXIT which will execute the contents of .logout on exit from the shell. This will also work with the System V.2 Bourne shell, since it too has the trap command. -- W.N.Paul, Int. Institute f. Applied Systems Analysis, A-2361 Laxenburg--Austria PHONE: +43-2236-71521-465 INTERNET: wnp%iiasa@relay.eu.net FAX: +43-2236-71313 UUCP: uunet!iiasa!wnp HOME: +43-2236-618514 BITNET: tuvie!iiasa!wnp@awiuni01.BITNET
ar@mcdd1 (Alastair Rae) (12/21/90)
I get .logout in ksh by the following --
.profile:
ENV=$HOME/.login
.login:
alias exit='[ -f ~/.logout ] && . ~/.logout; exit'
ENV=$HOME/.kshrc
set -o ignoreeof
OK, so I have to type 'exit' to log off but I can still use ^D in
sub shells.
--
.--------------.--------------------.----------------.--------------------.
| Alastair Rae | uunet!ukc!mcdd1!ar | +44 442 272071 | *Usual disclaimer* |
`--------------^--------------------^----------------^--------------------'
msb@cbnewsh.att.com (michael.s.balenger) (12/22/90)
>>>>> 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
----------------------------------------------------------------------
<cute quote> Michael S. Balenger (908) 949-8789
<cute disclaimer> 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