Skip site navigation (1)Skip section navigation (2)
Date:      12 Aug 2010 15:35:35 -0000
From:      John Levine <johnl@iecc.com>
To:        freebsd-questions@freebsd.org
Cc:        jacks@sage-american.com
Subject:   Re: Grepping a list of words
Message-ID:  <20100812153535.61549.qmail@joyce.lan>
In-Reply-To: <3.0.1.32.20100812073855.00ec5e98@sage-american.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>>% egrep 'word1|word2|word3|...|wordn' filename.txt

>Thanks for the replies. This suggestion won't do the job as the list of
>words is very long, maybe 50-60. This is why I asked how to place them all
>in a file. One reply dealt with using a file with egrep. I'll try that.

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.

R's,
John



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100812153535.61549.qmail>