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