Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!uflorida!codas!killer!dcs!wnp From: wnp@dcs.UUCP (Wolf N. Paul) Newsgroups: comp.sys.ibm.pc Subject: Re: MKS Toolkit question Message-ID: <10@dcs.UUCP> Date: 15 Feb 88 12:49:40 GMT References: <1492@lll-lcc.aRpA> Reply-To: wnp@dcs.UUCP (Wolf N. Paul) Distribution: na Organization: DCS, Dallas, Texas Lines: 28 Keywords: MKS, unix, logout Summary: How to add .logout to the Bourne/Korn Shells In article <1492@lll-lcc.aRpA> uejio@lll-crg.UUCP (Jeremy Y. Uejio) writes: >Does anyone know how to execute commands before exiting the >login shell in MKS toolkit. I just bought the toolkit a few >days ago and have a bunch of other questions about setting >up the environment, speeding up access with a RAM disk, etc... One way which works on my System V machine (and should thus also work with the toolkit, according to their manual) would be to put the following lines into /etc/profile: case "$0" in -sh) trap ". $HOME/logout.sh" 0 1 # $HOME/.logout on UNIX ;; esac (If you already have such a "case/esac" construct in there, just add the trap command under the "-sh" case, and make sure there is no other trap command disabling this later on). Then you just need to create a file $HOME/logout.sh (or $HOME/.logout on UNIX) for each user containing the commands you want executed on logout or hangup. The case statement makes sure that this trap gets set only in the login shell (subshells normally don't have an argv[0] beginning with a dash). Wolf Paul wnp@dcs.UUCP wnp@killer.UUCP