The UNIX and Linux Forums  

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


UNIX Desktop for Dummies Questions & Answers Questions regarding GNOME, KDE, CDE, Open Office, etc go here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Array with special Characters donaldfung UNIX for Dummies Questions & Answers 1 06-08-2008 09:18 AM
Grep with Special Characters Vashj Shell Programming and Scripting 6 11-27-2007 02:51 AM
Special Characters in directory name tez UNIX for Dummies Questions & Answers 6 08-14-2006 04:06 PM
special characters nawnaw UNIX for Dummies Questions & Answers 2 05-18-2004 12:17 PM
awk/sed with special characters apalex Shell Programming and Scripting 5 05-06-2002 01:40 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-12-2008
Registered User
 

Join Date: May 2008
Location: India
Posts: 30
Stumble this Post!
Question grep with special characters

Hi there

I need to grep for a detail from a file. The pattern to search for involves escape sequences in it. This causes for the problem.

Code:
grep "P\_SOME\_STRING\_SEARCH" filename
Note, I have line like below in the file and expect it to grep.

Code:
 select *
   from my_system_param
 where param_name = 'P\_SOME\_STRING\_SEARCH' escape '\';
Thanks in advance.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-12-2008
robotronic's Avatar
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Stumble this Post!
Code:
grep -F "P\_SOME\_STRING\_SEARCH" filename
Reply With Quote
  #3 (permalink)  
Old 06-12-2008
Registered User
 

Join Date: May 2008
Location: India
Posts: 30
Stumble this Post!
Heck!!!

Got the following error.

Code:
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- F
I have Sun OS 5.8 and KSH.
Reply With Quote
  #4 (permalink)  
Old 06-12-2008
robotronic's Avatar
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Stumble this Post!
On Solaris you need to use "/usr/xpg4/bin/grep -F" or "fgrep" instead of "grep -F".
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0