home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!usc!cs.utexas.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!caen!spool.mu.edu!umn.edu!csus.edu!netcom.com!dman
- From: dman@netcom.com (Dallman Ross)
- Subject: Re: Performing simple math on a numeric file from csh
- Message-ID: <1992Dec17.093546.9935@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- X-Newsreader: TIN [version 1.1 PL7]
- References: <1992Dec16.080343.24756@netcom.com>
- Date: Thu, 17 Dec 1992 09:35:46 GMT
- Lines: 34
-
- I, Dallman Ross (dman@netcom.com), wrote:
- : I am trying to understand awk, but the man pages are driving me nuts.
- : Anyway, I have a couple of simple files with numerics in them that I
- : want to do some math with. This doesn't have to be via awk, but I've
- : been told that's the ticket. Anyway, I use csh.
- :
- : Here's what one of the files looks like:
- :
- : > login: Dec 15 21:40:01
- : > logout: Dec 15 21:40:18
- : >
- : > login: Dec 15 21:41:11
- : > logout: Dec 15 21:41:48
- : >
- : > login: Dec 15 22:20:08
- : > logout: Dec 15 22:31:44
- : >
- :
- : (No >'s in the file, of course.) So, I want to subtract the
- : penultimate time figure from the last figure, and come up with
- : "00:11:36" as the answer for time logged in. I only need to do the
- : math on the last pair. The rest is just a running log.
- :
- : Thanks for any advice.
-
- Still hoping for some help on this. One person did email me, but I
- haven't seen any tips on command lines yet.
-
- --
- __D_a l_l m a_n _ R o_s s _ |dman@netcom.com /or/ |"You sound like a man|
- l \\ l\\ /l /\\ l\\ l |dross@well.sf.ca.us |with a rubber nose." |
- l >)l \\ /ll / \\ l \\ l |vox/fax: 1.510.645.1883| -- One-Lung Bill |
- l // l \X ll/--- \\l \\ l |350 Perkins St., #108 | Remmer (deceased)
- _l//______________________\\l_|Oakland,_CA__94610-3422|_____________________|_
-