Need help with 'LAST' command!
Allo,
I am hoping that someone could shed some light on my little problem that I have encountered.
I am trying to write a script that when run with no operands lists all the logged in user's online activity for the current month, then at the end of the list show the user's total time for that month.
So far I've got it pulling the LOGNAME and displaying that users times and dates, but I am having trouble in having them calculate the totals.
Here is what I have so far:
echo $LOGNAME > logfile
last | grep `cut –c1-8 logfile` > logfile
awk ‘{print $10}’ logfile > userlogs
cat userlogs
Here are the results:
in
(00:48)
(00:43)
(00:27)
If anyone knows how I can add these together then please shed some light on this subject.
Jay
|