Subject: Re: xargs
To: None <tech-userlevel@netbsd.org>
From: Denis Lagno <dlagno@rambler.ru>
List: tech-userlevel
Date: 03/28/2006 14:14:40
On Tue, Mar 28, 2006 at 11:34:55AM +0200, joerg@britannica.bec.de scribed:
> On Tue, Mar 28, 2006 at 11:57:27AM +0400, Denis Lagno wrote:
> > Hi guys,
> > 
> > Recently on -current I launched command like:
> > find somedir | xargs grep someword
> > 
> > and I received:
> > xargs: grep: Argument list too long
> > 
> > Of course, providing -n option to xargs solved this problem.
> > However I wonder is it a correct behaviour of xargs?  I thought one of purposes of xargs
> > is to have default values to prevent that issue.
> 
> huh? Not all programs can be invoced more than once without manual
> intervention. Just think about find foo -name \*.o | xargs cc -o bar.
> That can't work with -n directly.

Probably you did not get my point.

It does not matter whether it is
find somedir | xargs grep someword

or

find somedir | xargs echo someword

The same error in both cases: 
xargs: ????: Argument list too long

So the problem is that xargs splits argument list into too big chunks.
In my opinion xargs must know the limitations of the system
on size of the argument list.

-- denis