From owner-freebsd-questions@FreeBSD.ORG Thu Aug 12 16:02:16 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 475FC1065670 for ; Thu, 12 Aug 2010 16:02:16 +0000 (UTC) (envelope-from prvs=08336d2004=johnl@iecc.com) Received: from gal.iecc.com (gal.iecc.com [64.57.183.53]) by mx1.freebsd.org (Postfix) with ESMTP id CABFD8FC1F for ; Thu, 12 Aug 2010 16:02:15 +0000 (UTC) Received: (qmail 17267 invoked from network); 12 Aug 2010 15:35:35 -0000 Received: from mail1.iecc.com (64.57.183.56) by mail1.iecc.com with QMQP; 12 Aug 2010 15:35:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:subject:in-reply-to:cc:mime-version:content-type:content-transfer-encoding; s=k1008; olt=johnl@user.iecc.com; bh=wk2vSLuIHtUzQsll4XKnqOM4YJRbXUnKQbjASQ52RJM=; b=QFk2nAVUj9XHmjz31Hl25n14FX2tFopKY7m6Thq1YhCQb4UV0Fqv9lLkE/9PuQ9RO0rbFRO9TPfbXlB2GdH7CWgsrGyAPw5xdc4kIBq8gIcnR/6aeD2YVhKNHjAYgOHpyIb/b5WJCWBeaiWCcW3IcuwAmJgvmuIcqohLgK/1uqk= Date: 12 Aug 2010 15:35:35 -0000 Message-ID: <20100812153535.61549.qmail@joyce.lan> From: John Levine To: freebsd-questions@freebsd.org In-Reply-To: <3.0.1.32.20100812073855.00ec5e98@sage-american.com> Organization: X-Headerized: yes Mime-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Cc: jacks@sage-american.com Subject: Re: Grepping a list of words X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 16:02:16 -0000 >>% 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