From owner-freebsd-questions@FreeBSD.ORG Thu Aug 12 10:40:49 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B643F1065673 for ; Thu, 12 Aug 2010 10:40:49 +0000 (UTC) (envelope-from dan@slightlystrange.org) Received: from catflap.slightlystrange.org (cpc2-cmbg1-0-0-cust385.cmbg.cable.virginmedia.com [82.21.105.130]) by mx1.freebsd.org (Postfix) with ESMTP id 6CD058FC1B for ; Thu, 12 Aug 2010 10:40:49 +0000 (UTC) Received: from dan by catflap.slightlystrange.org with local (Exim 4.72 (FreeBSD)) (envelope-from ) id 1OjVDM-000DnZ-60 for freebsd-questions@freebsd.org; Thu, 12 Aug 2010 11:40:48 +0100 Date: Thu, 12 Aug 2010 11:40:48 +0100 From: Daniel Bye To: freebsd-questions@freebsd.org Message-ID: <20100812104048.GA46142@catflap.slightlystrange.org> Mail-Followup-To: freebsd-questions@freebsd.org References: <3.0.1.32.20100811180022.00ee4250@sage-american.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: <3.0.1.32.20100811180022.00ee4250@sage-american.com> User-Agent: Mutt/1.4.2.3i X-PGP-Fingerprint: D349 B109 0EB8 2554 4D75 B79A 8B17 F97C 1622 166A X-Operating-System: FreeBSD 8.1-STABLE amd64 Sender: Daniel Bye Subject: Re: Grepping a list of words X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Bye List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 10:40:49 -0000 --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 11, 2010 at 06:00:22PM -0500, Jack L. Stone wrote: > Kindly appreciate help with how to grep (or similar) a list of words to > determine if any of them are in a file rather than grepping one word at a > time. Something like this should do the trick: egrep "(word1|word2|word3)" file Dan --=20 Daniel Bye _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkxjz7AACgkQixf5fBYiFmqW5ACghMLJtHfxowUXRHKQXb0D6dOH 2FgAoJAi+zsjUklZzu56K5Mug4n7BuBn =j0rC -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--