home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!umn.edu!csus.edu!netcom.com!dman
- From: dman@netcom.com (Dallman Ross)
- Newsgroups: comp.unix.questions
- Subject: Performing simple math on a numeric file from csh
- Message-ID: <1992Dec16.080343.24756@netcom.com>
- Date: 16 Dec 92 08:03:43 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- Lines: 30
- X-Newsreader: TIN [version 1.1 PL7]
-
- 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.
-
- --
- __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|_____________________|_
-