[NTLUG:Discuss] Finding different strings in a single file

Leroy Tennison leroy_tennison at prodigy.net
Thu Dec 6 23:26:05 CST 2007


I have a situation where I need to check for several strings in a given 
file.  For example, are the following listed in /etc/services:

chargen
echo
discard
daytime

What I've done so far is grep for each one individually but it's getting 
old.  I could write an awk script but I'm not sure that's less painful. 
  Is there a more elegant method?  In looking at 'find' I noticed xargs 
but it's man page was close to totally unilluminating to me.





More information about the Discuss mailing list