Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More grep help, who would have thought. 1

Status
Not open for further replies.

chanman525

IS-IT--Management
Oct 7, 2003
169
US
This should be the last time that I need anyone's help for a while as this is the last piece to my script that I am building.

I have everything working the way I want it to as far as the information I'm gathering, except for the night shift part.

In my log file I have certain times from the night before that I need to pull in. Example of the log file...

Tue Mar 20 11:58:54 EDT 2007 : RF work for s990rs2 moved [113]-[354] by jeff
+37 Tue Mar 20 12:01:22 EDT 2007 : Radio s990ws4 reset by jeff
+38 Tue Mar 20 12:01:42 EDT 2007 : Radio 148 reset by jeff
+39 Tue Mar 20 13:25:48 EDT 2007 : RF work for s990cs5 moved [325]-[214] by jeff
+40 Tue Mar 20 13:53:27 EDT 2007 : Radio 112 reset by rmo


We can use 12:00:00 as a reference here (the time will be different in my script since night shift doesn't start until 6).

In this instance, I'm trying to gather everything later than 12:00:00.

I've looked all over trying to find anything on this, but there doesn't seem to be much out there. Which brings me to my next question. Does anyone have any good websites out there for grep that I can reference and quit bugging you guys? Thanks for all of your help.
 
Are they any other time contraints? ...later than 12 but earlier than ???
 
On that day, no. It will be anything from 12 oclock until the end of the day.
 
Using the same logic from the answer that RodKnowlton provided in one of your previous questions (
... on a side note: how do I post this such that says ThreadXYZ and is a link to that thread?

This should get you the desired results:

egrep '1([2-9]:([0-9][1-9]))|2([0-3]:)' some.file

This will result in any time 12:01 thru 23:59 being matched and displayed.
 
sbrews said:
... on a side note: how do I post this such that says ThreadXYZ and is a link to that thread?

by cutting and pasting the text containing the thread-id (just under the thread title) like so: thread52-1348057 (TGML does the rest)



HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top