From owner-freebsd-questions@FreeBSD.ORG Sat May 30 16:12:27 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 EE6831065677 for ; Sat, 30 May 2009 16:12:27 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id B85AC8FC0A for ; Sat, 30 May 2009 16:12:27 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from sarevok.dnr.servegame.org (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 07A697E840; Sat, 30 May 2009 08:12:27 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Sat, 30 May 2009 18:12:25 +0200 User-Agent: KMail/1.11.3 (FreeBSD/8.0-CURRENT; KDE/4.2.3; i386; ; ) References: <200905301412.50958.mel.flynn+fbsd.questions@mailing.thruhere.net> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905301812.25320.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Wojciech Puchar 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 16:12:28 -0000 On Saturday 30 May 2009 17:57:14 Wojciech Puchar wrote: > >> because it tells you the file in which the text pattern was found :). > > > > Discouraged because: > > - it's possible to hit maxarglen if the root directory has many > > subdirectories. > > xargs is usefull too. i would it as forking for each > file will make processing really slow. xargs can cut input data into given > chunks with -n option, so grep will be called for say 100 files at once. Cut off the message a bit later and you will see that using a '+' to terminate the exec primitive emulates xargs behavior: On Saturday 30 May 2009 14:12:50 Mel Flynn wrote: > I use + rather then ; so that one >invocation for grep is done whenever maxarglen is hit (like if you used >xargs(1)), rather then one grep per file. -- Mel