Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grep Question

Status
Not open for further replies.

BryanY

MIS
Aug 18, 2001
54
US
Ok, basically I want to search a text file to see if one word, or another word, or a third word is present.

I tried grep -F 'first second third' file

but it doesn't seem to work. Any suggestions?

(i used /usr/xpg4/bin/grep [Solaris] )
 
egrep '(first|second|third)' file

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
or:
/usr/xpg4/bin/grep -E '(first|second|third)' file

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top