This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xargs still nok?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]