Is there a Perl way to get the equivalent of the who shell command?
Output of the who command:
who
username 1 console Nov 1 12:07
username2 ttyp1 Nov 1 12:09
I've been running the shell command in backticks, but if I can get a
Perl way, I would be much happier.
--
Thanks,
James Reynolds
University of Utah
Student Computing Labs
james@scl.utah.edu
801-585-9811
Jeremy Mates - 01 Nov 2005 20:23 GMT
* James Reynolds <james123@scl.utah.edu>
> I've been running the shell command in backticks, but if I can get a
> Perl way, I would be much happier.
Minus a module to do this on CPAN, you get to parse the binary
/var/run/[wu]tmp files for the information, whose format is
documented in:
man 5 utmp
I believe the Perl Cookbook includes an example program to parse the
said file...