[Techtalk] Script to determine if logged in

Gutz, Lorne Lorne.Gutz at transcore.com
Wed May 18 22:30:18 EST 2005


If you just want to test to see if a spicific user
is logged in you can use  

  who | grep dan

this will only give you an output when dan is logged in.
This is something that can be easily tested for.

Have a great day
Lorne

-----Original Message-----
From: techtalk-bounces at linuxchix.org
[mailto:techtalk-bounces at linuxchix.org]On Behalf Of Dan
Sent: Wednesday, May 18, 2005 6: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.

-- 
The characters Bert and Ernie on Sesame Street were named after
Bert the cop and Ernie the taxi driver in Frank Capra's "It's A
Wonderful Life"


_______________________________________________
Techtalk mailing list
Techtalk at linuxchix.org
http://linuxchix.org/cgi-bin/mailman/listinfo/techtalk


More information about the Techtalk mailing list