![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot redirect ouput????? | minifish | Shell Programming and Scripting | 3 | 02-20-2008 08:15 AM |
| Wrong Ouput when using printf under SFU | ilak1008 | Windows & DOS: Issues & Discussions | 5 | 06-02-2007 12:20 AM |
| Identifying same character and ouput the sum | Raynon | Shell Programming and Scripting | 12 | 03-21-2007 07:59 PM |
| capture the ouput! | azmathshaikh | Shell Programming and Scripting | 0 | 12-20-2005 03:23 AM |
| Locating files and directing ouput | klannon | Filesystems, Disks and Memory | 2 | 03-10-2002 08:57 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Red Hat - ouput capture
Red Hat 7.2
On command line.. i need to ouput or capture just.. CPE3236313839393 Fri Nov 1 00:05 - 00:05 (00:00) the time inside the brackets (00:00) ... i havea list of about a hundred from sperate dates in a long file. I need to some how grep or i dunno all times from Nov 1 and get the total time for a spread sheet. Anyone know how??
__________________
[url=http://www.juxtapresentations.com][img]http://members.rogers.com/juxtapresentations.com/myfooter.gif[/img][/url] [url=www.urbanfocus.ca]Novice Photography Showcase[/url] |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
And how do i output that? just > file.txt at the end?
__________________
[url=http://www.juxtapresentations.com][img]http://members.rogers.com/juxtapresentations.com/myfooter.gif[/img][/url] [url=www.urbanfocus.ca]Novice Photography Showcase[/url] |
|
||||
|
I took it a step further to actually add up the times in case you want to use the total:
Code:
totHr=0
totMn=0
times=`grep "Nov 1" a | awk -F\( '{print $2}' | sed 's/)//g'`
for tm in $times
do
tmp=`echo $tm | awk '{ print substr($0,1,2) }'`
totHr=`expr $totHr + $tmp`
tmp=`echo $tm | awk '{ print substr($0,4,2) }'`
totMn=`expr $totMn + $tmp`
done
totHr=`expr $totHr + $totMn / 60`
totMn=`expr $totMn % 60`
echo $totHr "hrs," $totMn "min"
|
||||
| Google The UNIX and Linux Forums |