Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <43204FFF.74CDAC16@dessent.net> Date: Thu, 08 Sep 2005 07:51:43 -0700 From: Brian Dessent MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: xargs still nok? References: <20050908102658 DOT GC5555 AT calimero DOT vinschen DOT de> <4320281B DOT 6090005 AT lists DOT cichon DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com zzapper wrote: > Is Xargs still reqd for > > find . -name '*.cfm' -exec grep -i {} \; It's not required, but using the above you will have to fork() and exec() an individual copy of grep for each file, which will be horrendously slow. If you used xargs, it will call grep with as many filenames as will fit on one command line, so that grep is actually invoked as few times as is absolutely necessary. It's the difference between: grep -i foo bar00001.c grep -i foo bar00002.c ... grep -i foo bar00099.c # grep invoked 100 times versus grep -i foo bar00001.c bar00002.c ... bar00050.c grep -i foo bar00051.c bar00052.c ... bar00099.c # grep invoked twice Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/