Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!munnari.oz.au!bruce!trlluna!medici!phil From: phil@medici.trl.OZ.AU (Phil Nicholson) Newsgroups: comp.unix.questions Subject: Re: Is this a logout ? Message-ID: <2785@trlluna.trl.oz> Date: 8 Mar 91 08:06:59 GMT References: <1991Mar6.120728.10069@daimi.aau.dk> Sender: news@trlluna.trl.oz Reply-To: p.nicholson@trl.OZ.AU (Phil Nicholson) Organization: Telecom Research Laboratories, Melbourne, Australia Lines: 25 In article <1991Mar6.120728.10069@daimi.aau.dk>, ezra@daimi.aau.dk (Thomas Ravnholt) writes: > The question: How can I decide if it is a logout from > the rlogin. This works for me. In your .logout have (with csh) if(`tty` !~ /dev/tty[pqr]* ) then #not a pseudo tty, so presumably not an rlogin or telnet etc. commands... endif Roll your own if you use a different shell. Alternatively, you could awk your way through the output of ps to find out if the parent of the current process is in.rlogind. But this approach varies from one unix to another. Phillip Nicholson AI Systems Telecom Australia Research Labs email : p.nicholson@trl.oz.au phone : +61 3 541 6245 fax : +61 3 543 8863