The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-29-2007
trust123 trust123 is offline
Registered User
 

Join Date: Jun 2007
Posts: 3
egrep a certain pattern

hey guys this is my first post here, heard a lot about these forums. Iam urgently in need of a command which would help me accomplish the following , for example a file has these contents:

211 61 2007-06-26 13:47:32
211 61 2007-06-26 09:53:43
211 61 2007-06-26 15:25:14
211 61 2007-06-26 04:32:11
211 61 2007-06-26 21:12:36
211 61 2007-06-26 02:11:27



now , i need to EGREP a pattern which would give me the following output:

211 61 2007-06-26 13
211 61 2007-06-26 09

basically, all lines are same.. what i need to EGREP is in each line "the range of grepping would be from 211 to hours i.e 00,12,09 etc.

egrep -e "211 2007-06-26 $$" ??

date is fine ,everything is same..i just need to know the command which would grep me the contents uptil the 2 digits of HOURS.


urgent reply needed!! thanks!
Reply With Quote
Remove advertisements
!!
Forum Sponsor