Martin A. Brooks <mar...@antibodymx.net> wrote: > I have an array of strings. I have some plain text files on disk. I want to > see if any of the lines in the text files contain any of the strings in the > array. I can stop as soon as I find one match.
Does this work for you? $ grep -F -q -e needle1 -e needle2 -e needle3... haystack/*.txt You may find it simpler to put the needles in another file, one per line, and use `-f needles.txt` instead of the multiple `-e` options, especially if you have a very large number of needles. -- Aaron Crane ** http://aaroncrane.co.uk/