[comp.unix.shell] KSH .logout script ?

uniel@uts.uni-c.dk (Erik Lawaetz) (03/18/91)

Is there a KSH logout script like csh's .logout ?

--------------------------------------------------------------------------------
Erik Lawaetz                 UNI*C Lyngby
                             Danish Computing Centre for Research and Education.
+45 45 93 83 55              DTH, Building 305
uniel@uts.uni-c.dk           DK-2800 Lyngby
--------------------------------------------------------------------------------

lee@chsun1.uchicago.edu (Dwight A Lee) (03/21/91)

uniel@uts.uni-c.dk (Erik Lawaetz) writes:

>Is there a KSH logout script like csh's .logout ?

You can use the trap command to execute a command upon EXIT:

    trap ~/.logout EXIT

which will run the .logout script n your home directory when you exit
ksh.  This works for other signals too; check the man page (or book)
for details.

>----------------------------------------------------------------------------
>Erik Lawaetz             UNI*C Lyngby
>                         Danish Computing Centre for Research and Education.
>+45 45 93 83 55          DTH, Building 305
>uniel@uts.uni-c.dk       DK-2800 Lyngby
>----------------------------------------------------------------------------
-- 
Dwight A Lee / lee@chsun1.uchicago.edu / T904107@niucs.BITNET / tCS/BB / Font
I speak only for myself.  /  "I am not the only dust my mother raised" - TMBG

linwood@cbnewsk.att.com (linwood.d.johnson) (03/24/91)

In article <1991Mar18.095244.9728@uts.uni-c.dk>, uniel@uts.uni-c.dk (Erik Lawaetz) writes:
> Is there a KSH logout script like csh's .logout ?

If you want a series of commands executed at logout, place
the following line in your .profile

trap "$HOME/.logout" 0 1

Of course, this assumes that the file named .logout exists and thatit
resides in your home directory.



-- 
| Linwood D. Johnson       |  linwood@ihlpf.att.com                 |
| AT&T Bell Labs, 1000 E. Warrenville Rd., Naperville, IL 60566     |
| Disclaimer: Opinions expressed here are mine and mine only.       |
|             Besides, who else would want them?                    |

rmk@rmkhome.UUCP (Rick Kelly) (03/24/91)

In article <1991Mar18.095244.9728@uts.uni-c.dk> uniel@uts.uni-c.dk (Erik Lawaetz) writes:
>Is there a KSH logout script like csh's .logout ?

No.

Rick Kelly	rmk@rmkhome.UUCP	frog!rmkhome!rmk	rmk@frog.UUCP