The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unix grep/test command netmaster UNIX for Dummies Questions & Answers 1 10-09-2007 02:29 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-04-2007 11:59 PM
grep command naamas03 UNIX for Dummies Questions & Answers 3 09-17-2007 12:14 AM
grep command pmsuper UNIX for Dummies Questions & Answers 6 11-22-2006 03:12 AM
grep command whatisthis UNIX for Dummies Questions & Answers 3 09-02-2004 08:01 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-18-2006
Registered User
 

Join Date: Apr 2006
Posts: 21
unix grep command

I need to seach all strings that matches "if [ 1 -eq 2 ]; then" in all files

If i put
grep "if [ 1 -eq 2 ]; then" *.* it is not giving any result
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-18-2006
Registered User
 

Join Date: Sep 2006
Posts: 1,543
can you see if your version of grep have the -F switch? if yes, then you could use it for your case
Quote:
-F Match using fixed strings. Treat each pattern speci-
fied as a string instead of a regular expression. If
an input line contains any of the patterns as a con-
tiguous sequence of bytes, the line will be matched. A
null string matches every line. See fgrep(1) for more
information.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




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


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

Content Relevant URLs by vBSEO 3.2.0