LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-05-2002, 10:01 AM   #1
jaymdouglas
LQ Newbie
 
Registered: Apr 2002
Location: Thunder Bay, Ontario, Canada
Posts: 5

Rep: Reputation: 0
Question 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
 
Old 04-05-2002, 10:45 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
please don't double post. it does SAY that right next to this box...

Last edited by acid_kewpie; 04-05-2002 at 10:48 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 02:23 AM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 07:14 PM
Command to display whole filestructure hierarchy f/ command line? mjewell Linux - Newbie 10 01-19-2004 10:48 AM
Where is Command line utility for Cups and command tutorial mossy Linux - Software 8 01-16-2004 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration