.suffile/.logout in ksh
Jeff Benjamin
benji at hpfcdq.HP.COM
Sat May 27 02:10:50 AEST 1989
> Does anyone know how to get a ".suffile" file to work for ksh?
I assume you mean the equivalent of csh .logout, to do something
when you exit a session?
Ksh does not do anything like this for you automatically; you have
to set up your .profile to trap the signal generated on a logout and
then execute a command.
Syntax for a ksh "trap" is: trap [arg] [sig]..., where "arg is a command
read and executed when the shell receives signal(s) sig."
See the ksh man page for more info.
The line to do this in my .profile looks like:
trap $HOME/.logout 0
This says "when you receive signal 0 (logout), execute $HOME/.logout".
So my .logout file is executed when I logout from ksh as well as
from csh.
-----
Jeff Benjamin {ucbvax,hplabs}!hpfcla!benji
Graphics Technology Division benji%hpfcla at hplabs.HP.COM
Hewlett Packard Co. Fort Collins, Colorado
More information about the Comp.unix.questions
mailing list