The UNIX and Linux Forums  

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


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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
regular expressions whatever Shell Programming and Scripting 4 05-20-2007 01:30 PM
Help with regular expressions arushunter Shell Programming and Scripting 13 12-23-2006 08:31 PM
grep and regular expressions : Browser_ice UNIX for Dummies Questions & Answers 2 08-14-2006 11:10 PM
More Grep - Regular Expressions Jombee UNIX for Dummies Questions & Answers 7 09-05-2005 09:55 AM
Regular expressions in sed mfreemantle UNIX for Dummies Questions & Answers 3 02-11-2002 05:34 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-08-2005
Registered User
 

Join Date: Sep 2004
Posts: 32
grep where expressions reside in file

I have a program that displays many messages on stdout.
I have another file that contain error messages only - Each line is a separate message. (msgs.txt)

I am trying to show only the errors and not all the output.

I tried this but got nothing:

myprog | grep < msgs.txt

I also tried this

myprog | grep < `cat msgs.txt`

but both did not work....

Any suggestions?

Thanks a lot
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-08-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
myprog | grep -f msgs.txt
Reply With Quote
  #3 (permalink)  
Old 03-08-2005
Registered User
 

Join Date: Sep 2004
Posts: 32
I found that when I use -f alone grep displays all the input file and that -wf works well.

Thanks for your help.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:35 AM.


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