> Gee, 50 words, that's about a 300 character pattern, that's not a problem
> for any shell or version of grep I know.
>
> But reading the words from a file is equivalent and as you note most
> likely easier to do.
The question is what is more efficient. This might be
important if that kind of grep command is run very often
by a script, or if it's run on very large files.
It's exactly the same, since it's the same program using the same search
algorithm. The only thing that's different is the input language for the
pattern. What looks like a bunch of separate patterns in the input file
is internally turned into one pattern that is then compiled into a state
machine that it uses to match the input.
R's,
John
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"