delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/08/10:45:11

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 8 Sep 2005 16:42:47 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: xargs still nok?
Message-ID: <20050908144247.GG5555@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <on00i11u7d2a93lkl1hu98sav3kvi0c5cj AT 4ax DOT com> <20050908102658 DOT GC5555 AT calimero DOT vinschen DOT de> <4320281B DOT 6090005 AT lists DOT cichon DOT com> <uji0i1d0k7f1ehc6h48u2kr0e5kajmctpp AT 4ax DOT com>
Mime-Version: 1.0
In-Reply-To: <uji0i1d0k7f1ehc6h48u2kr0e5kajmctpp@4ax.com>
User-Agent: Mutt/1.4.2i

On Sep  8 15:29, zzapper wrote:
> On Thu, 08 Sep 2005 14:01:31 +0200,  wrote:
> >Corinna Vinschen wrote:
> >>On Sep  8 10:26, zzapper wrote:
> >>>$ ls *.cfm */*.cfm */*/*.cfm */*/*/*.cfm | xargs grep -i host
> >>>bash: /usr/bin/ls: Argument list too long
> >>  ^^^^^^^^^^^^^^^^^
> >>  Nothing to do with xargs.  Use find instead of ls/w wildcards.
> >>
> >yes, you should rather write
> >$ find . -name "*.cfm" -print0 | xargs -0 grep -i host
> 
> Is Xargs still reqd for
> 
> find . -name '*.cfm' -exec grep -i {} \;

Did you try it before asking?  Just a hint, in the above case "grep"
is called once per file, when using xargs, it's only called as often
as necessary with a filled command line, so using xargs is usually
faster.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019