From owner-freebsd-questions@FreeBSD.ORG Fri Sep 26 12:32:20 2008 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 423A91065691 for ; Fri, 26 Sep 2008 12:32:20 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 141888FC28 for ; Fri, 26 Sep 2008 12:32:19 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id 2A0D9AFBC01; Fri, 26 Sep 2008 04:32:19 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org Date: Fri, 26 Sep 2008 14:32:17 +0200 User-Agent: KMail/1.9.7 References: <48DCD201.2000402@ibctech.ca> <48DCD403.8010603@ibctech.ca> In-Reply-To: <48DCD403.8010603@ibctech.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809261432.17656.fbsd.questions@rachie.is-a-geek.net> Cc: Steve Bertrand Subject: Re: Iterate through directories and search into files 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: Fri, 26 Sep 2008 12:32:20 -0000 On Friday 26 September 2008 14:22:27 Steve Bertrand wrote: > Steve Bertrand wrote: > > Hi everyone, > > > > I have a list of directories: > > > > - a..z and 2003..2008 > > > > ...inside of a single directory. > > > > Can someone advise what the shortest shell pipeline would be to search > > for two words (on two separate lines) within all files located only the > > alpha directories, and then print the filename to STDOUT? > > ...what I meant to say was that both patterns will be on the SAME line, > as a single instance example, I would do: > > cat a/file.fil | grep -i comment | grep 355 find ./[a-z]* -type f -exec grep -il 'comment.*355' {} + -- Mel Problem with today's modular software: they start with the modules and never get to the software part.