Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / November 2005



Tip: Looking for answers? Try searching our database.

Finding currently logged in users

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RD - 01 Nov 2005 23:31 GMT
Hi,

I am writing an application which needs to determine all the users that
are currently logged into the system and then send them messages (using
the 'write' command). Please note that I do not want to broadcast the
message to all the users. I want to send custom message to each user.

The issue that I am facing is: how do I identify all the users who are
currently logged in? The problem with using the "who" command is that
on certain systems (e.g. Mac OS X, SuSE, older Solaris) it truncates
the user name to 8 characters. So if there are 2 users called abcdefghi
and abcdefghij logged in, both show as abcdefgh in the output of the
"who" command.

Each user on the system should have a unique userid UID. Can somebody
suggest to me a way to list the UIDs of all the users that are
currently logged into the system. That will solve the problem because
then I can look into the passwd file to determine their usernames and
send them messages using the 'write' command.

If anybody has other ideas I am eager to listen..

Thanks in advance,
RD.
matt neuburg - 02 Nov 2005 00:36 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> The issue that I am facing is: how do I identify all the users who are
> currently logged in?

man users

???

m.

Signature

matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/exec/obidos/ASIN/0596005571
Read TidBITS! It's free and smart. http://www.tidbits.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.