From owner-freebsd-questions@FreeBSD.ORG Sat May 30 18:08:56 2009 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 035821065670 for ; Sat, 30 May 2009 18:08:56 +0000 (UTC) (envelope-from walt@wump.org) Received: from que11.charter.net (que11.charter.net [209.225.8.21]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3E98FC0C for ; Sat, 30 May 2009 18:08:55 +0000 (UTC) (envelope-from walt@wump.org) Received: from imp09 ([10.20.200.9]) by mta31.charter.net (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20090530173913.BZQL2647.mta31.charter.net@imp09>; Sat, 30 May 2009 13:39:13 -0400 Received: from [10.0.0.10] ([68.116.98.9]) by imp09 with smtp.charter.net id xtfB1b00B0C8vLc05tfCj9; Sat, 30 May 2009 13:39:13 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20090530183239.a6755d97.freebsd@edvax.de> Date: Sat, 30 May 2009 10:39:06 -0700 To: Wojciech Puchar , Polytropon From: Walt Pawley Content-Type: text/plain; charset="us-ascii" Cc: Zbigniew Szalbot , freebsd-questions@freebsd.org Subject: Re: find and searching for specific expression in 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: Sat, 30 May 2009 18:08:56 -0000 At 6:44 PM +0200 5/30/09, Wojciech Puchar wrote: >> the famous back-tics. >> >> % grep "expression" `find /path/to/files/ -mtime -2 -print` >> >> Of course, there are surely easier, faster and better means, >> but from this one, I know it just works. :-) Furthermore, I > >unless filelist exceed max lenght of arguments and unfortunately it >happens often I use bash as my default shell and have become rather enamored with the construct | while read x; do "$x"; done which should get around the list length limitations and provides for doing "extras" between the "do" and the "done". Specifically: find /path/to/files/ -mtime -2 -print | \ while read x; do grep "expression" "$x"; done -- Walter M. Pawley Wump Research & Company 676 River Bend Road, Roseburg, OR 97471 541-672-8975