in reply to Help with script to search all files for certain words.

Most greps have an option to give a filename containing a list of strings to search for, so use that. Since you're using words rather than patterns, use the fixed strings option as well:

find blah blah blah | xargs grep -i --fixed-strings --file=words.dat

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Help with script to search all files for certain words.
by afoken (Chancellor) on Jan 11, 2011 at 09:23 UTC
    find blah blah blah | xargs grep -i --fixed-strings --file=words.dat

    Change that to ...

    find blah blah blah -print0 | xargs -0 grep -i --fixed-strings --file= +words.dat

    ... and problems with "funny" filenames are gone.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)