Summary: Detecting logout of User

From: Mark Evans (mre1@itri.bton.ac.uk)
Date: Fri Oct 09 1992 - 04:38:03 CDT


Thank you for all the replies. Some of the most useful were:

--------------------------------------------------------------

You didn't give the O/S version, so it's pretty hard to get
that answer. About the best you can do is find the login shell
entry in the /etc/utmp file and wait for it to disappear. That
isn't an easy trick in a windowing environment. On the other
hand you could take the conservative approach and just use

        if [ `who | grep $USER | wc -l` -eq 0 ] ; then
                sort your files
        fi

John F. Haugh II

--------------------------------------------------------------

In your .logout

if ('tty' == console) then
        .......
endif

Joe Minieri

--------------------------------------------------------------

> In your /etc/profile put:
>
> trap "......" 0
>
> Where ....... is a command or script file, stick this at the top of
> your /etc/profile and document it so the next guy knows what you're
> up to.

Jerry Rocteur

This won't for for shells that don't use /etc/profile. (Of which
there are very many) Plus this will be totally useless under many
windowing systems that may spawn multiple login shells. (xterm -ls)

Dave Barr

--------------------------------------------------------------

Thank you again for everyones help.

Regards,

Mark

+-------------------------------------------------------------+
| |
| Mark Evans e-mail: mre1@itri.bton.ac.uk |
| uucp: uknet!itri!mre1 |
| ITRI, Univeristy of Brighton, Tel: +44 273 642915 |
| Lewes Road, Brighton, Fax: +44 273 606653 |
| E. Sussex, BN2 4AT, UK. |
| |
+-------------------------------------------------------------+



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:51 CDT