[comp.unix.admin] get user's idle time

ping@cubmol.bio.columbia.edu (Shiping Zhang) (11/28/90)

Could anyone tell me how to get an user's idle time? Either from
system calls in C or from a shell script. Thanks.

-ping

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (11/28/90)

In article <1990Nov27.202215.4061@cubmol.bio.columbia.edu> ping@cubmol.bio.columbia.edu (Shiping Zhang) writes:
| Could anyone tell me how to get an user's idle time? Either from
| system calls in C or from a shell script. Thanks.

  The latest version of my screen blanker looks at the time since last
modification of the virtual terminal. It's easy to extend this to serial
or ethernet lines.
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me

alex@bma35b.ma02.bull.com (Alex Bottonelli) (12/12/90)

In article <1990Nov27.202215.4061@cubmol.bio.columbia.edu>, ping@cubmol.bio.columbia.edu (Shiping Zhang) writes:
> Could anyone tell me how to get an user's idle time? Either from
> system calls in C or from a shell script. Thanks.
> 
> -ping

On my system ( System V ) who accepts a -u option that will display
the idle time of a user's tty ( a dot '.' for no idle time ). Does
your system have such a option for who ? Hope it helps

     ____        ___ 		||  Alessandro Bottonelli
    /   /  /    /    |/		||  Bull Hn Italia
   /---/  /    /---  /		||  141 Needham St. - Ms 213
  /   /  /___ /___  /|		||  Tel. xx1-617-552-6471
_____________________)		||  Fax. xx1-617-552-5318
				||  Net. ..!uunet!hbiso!bma35b!alex