The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-02-2007
mpang_ mpang_ is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 89
Retrieve message from file

Hey all, I have this file which contains a lot of messages in format like

[2/2/07 13:23:00] This is my message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Check This!
[2/2/07 13:23:10] This is my second message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
[2/2/07 13:24:48] This is my third message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!

when I do "grep" on this file using "2/2/07 13:23", it returned

[2/2/07 13:23:00] This is my message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2/2/07 13:23:10] This is my second message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

but in fact I want

[2/2/07 13:23:00] This is my message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Check This!
[2/2/07 13:23:10] This is my second message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!

since these messages span over several lines, could anyone tell me how to achieve what I need? Thank you so much!