Script to search a large file with a list of terms in another file

Hi-

I am trying to search a large file with a number of different search terms that are listed one per line in 3 different files. Most importantly I need to be able to do a case insensitive search.
I have tried just using egrep -f but it doesn't seam to be able to handle the -i option when selecting a file for the search terms.

Any suggestions?

the following command should work:

egrep -i -f patterns file

do you get an error? or why do you say it doesn't handle the "-i"?

Because using that command turns up no results when terms in the patterns file are lowercase and instances in the searched file are not.

---------- Post updated at 02:03 PM ---------- Previous update was at 01:25 PM ----------

I guess I am looking for the proper way to read in a list of search terms from a file or files and then use them one by one to grep a large file. That might allow me some flexibility to find instances in the searched file that match relatively closely. Either because of case, or different spacing for multiple word strings.
Using egrep -i -f seems to get me an all or nothing result.

Thanks for any help.

Hi.

The egrep -i -f pattern-file data-file worked for me.

Please post short representative samples of the data, patterns, and expected output that you want to see ... cheers, drl