[Techtalk] Script to determine if logged in
Maria McKinley
maria at shadlen.org
Thu May 19 05:33:21 EST 2005
I agree. I generally find w more accurate than who, which sometimes
comtinues to list people after they have logged out for some reason.
I'm not sure where who gets its info, but w actually checks the proccesses.
cheers,
maria
Meryll Larkin wrote:
> Use "w" to find who is logged in and what they are doing
>
> With cron you don't need to be logged in to get the message if you have the
> command output emailed to yourself or messaged in some other way outside the
> system.
>
> Put it together with either a Perl script or shell plus awk (maybe plus
> sed).
>
> Meryll
>
>
> -----Original Message-----
> From: techtalk-bounces at linuxchix.org [mailto:techtalk-bounces at linuxchix.org]
> On Behalf Of Dan
> Sent: Wednesday, May 18, 2005 3:35 AM
> To: Techtalk
> Subject: [Techtalk] Script to determine if logged in
>
> I'm trying to write a cron job to determine if I'm logged in. There are
> several kludges that I could use, but does anyone know of a good way?
>
> As a variant, is there a good way to determine if ANYONE is logged in,
> or logged into X Windows?
>
> Such a script is possible but not easy to test, because part of testing
> it requires, er, running the program without being logged in.
>
More information about the Techtalk
mailing list