![]() |
|
Just another Perl shrine | |
PerlMonks |
parsing output of UNIX `who` commandby chinamox (Scribe) |
on Oct 02, 2006 at 07:58 UTC ( #575843=perlquestion: print w/replies, xml ) | Need Help?? |
chinamox has asked for the wisdom of the Perl Monks concerning the following question:
Greetings again all of you good monks.
I am attempting to set up a very simple Perl app using the 'who' command in Unix. Basically I want to set up a simple hash using somthing like:
I would then like then like to set each of the returned usernames as keys for the hash and have the values in the hash show the number of sessions that a user is logged in. The read out would look something like:
I have a strong urge to try the functions keys(%hash) and values(%hash) but I think I also might be haveing problems passing data from that 'who' command. Thank you in advanced, I am trying to learn Perl from my home in Beijing with very limited help in meatspace. I have been ramming my head into the desks for the last few hours and the this is upseting the little old lady nextdoor. If anyone can offer a hint, you would be my hero for the day (or night). 2006-10-02 Retitled by planetscape, as per Monastery guidelines
Back to
Seekers of Perl Wisdom
|
|