The UNIX and Linux Forums  

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



Thread: Recursive grep
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #10 (permalink)  
Old 05-17-2008
upstate_boy upstate_boy is offline
Registered User
 

Join Date: May 2008
Posts: 8
Thanks for the suggestion Franklin52. I do see the echo showing the full string now, but the results of the grep are off.

If I do the grep manually - I get 3 files returned which is correct.

If I use my script - I get 1588 files returned.

Script now:

OIFS=$IFS
IFS=""

for h in `cat strings.txt`; do echo $h ; grep -rl "$h" /path/to/search/ >> results.txt ; done

IFS=$OIFS
Reply With Quote