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


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 !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-12-2012
Registered User
 
Join Date: Apr 2010
Posts: 132
Thanks: 16
Thanked 1 Time in 1 Post
How to grep this pattern?

Guys, I have a certain pattern of string in one of my logs. The pattern is below:


Code:
07:42:56,613 INFO :: TracingMyNewMessage[PRIVATE_TESTINGSYSTEM-04PQ]: 35=849=OOPLKCV56=YYUNBHJ57=uujhio2=20120612-11:42:56.613128=OOIUJKJN150=020=011=_poiu88785=X32=044=106=031=554

(the above is one continious line)

I do a grep like this:

Code:
grep -i "TracingMyNewMessage[PRIVATE_TESTINGSYSTEM-04PQ]" mylog.dat

and i get nothing.

What pattern should i use to search for

Code:
"TracingMyNewMessage[PRIVATE_TESTINGSYSTEM-04PQ]" ?

Thanks
Sponsored Links
    #2  
Old 06-12-2012
rangarasan's Avatar
Registered User
 
Join Date: Jul 2011
Location: Chennai, India
Posts: 484
Thanks: 9
Thanked 119 Times in 115 Posts
grep

Hi,
Try this,

Code:
grep -i "TracingMyNewMessage\[PRIVATE_TESTINGSYSTEM-04PQ\]" mylog.dat

Here [ and ] are special characters.

Cheers,
Ranga
The Following User Says Thank You to rangarasan For This Useful Post:
DallasT (06-12-2012)
Sponsored Links
    #3  
Old 06-12-2012
Registered User
 
Join Date: Apr 2010
Posts: 132
Thanks: 16
Thanked 1 Time in 1 Post
worked!
Thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Want to grep for a pattern and display the content above that pattern ajayakunuri Shell Programming and Scripting 6 06-25-2010 06:48 AM
How to grep for certain pattern aoussenko Shell Programming and Scripting 4 09-15-2009 07:37 PM
how to grep certain pattern aoussenko Shell Programming and Scripting 5 05-15-2009 10:58 AM
how to grep the pattern ? faviji Shell Programming and Scripting 2 08-12-2008 08:37 AM
grep for pattern aemunathan Shell Programming and Scripting 12 05-09-2008 02:58 AM



All times are GMT -4. The time now is 06:14 PM.