From owner-freebsd-questions@FreeBSD.ORG Fri Sep 26 12:13:45 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 7104510656CA for ; Fri, 26 Sep 2008 12:13:45 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: from ibctech.ca (v6.ibctech.ca [IPv6:2607:f118::b6]) by mx1.freebsd.org (Postfix) with SMTP id 0F72C8FC21 for ; Fri, 26 Sep 2008 12:13:44 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: (qmail 2087 invoked by uid 89); 26 Sep 2008 12:14:23 -0000 Received: from unknown (HELO ?IPv6:2607:f118::5?) (steve@ibctech.ca@2607:f118::5) by 2607:f118::b6 with ESMTPA; 26 Sep 2008 12:14:23 -0000 Message-ID: <48DCD201.2000402@ibctech.ca> Date: Fri, 26 Sep 2008 08:13:53 -0400 From: Steve Bertrand User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: "freebsd-questions@freebsd.org Questions -" X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: 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:13:45 -0000 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? I know this is very efficient, but since I don't need to do this often, it will be easier than maintaining but yet another Perl script. Thanks, Steve