xargs gives grep/gawk too much

Buchbinder, Barry (NIH/NIAID) [E] BBuchbinder@niaid.nih.gov
Fri Dec 8 18:05:00 GMT 2006


I get the following error message:
	xargs: grep: Argument list too long
I've also gotten an equivalent error from xargs/gawk.

Of course, the whole idea of xargs is to avoid this error.  If I'm doing
something wrong, I'd appreciate some hints of what I am doing wrong or
how to avoid this (other than "-s").  Otherwise, I suppose that this is
a bug report.

The grep pipe, run under bash, that generates the error message is as
follows:

	$ echo path/* | \
		tr ' ' '\n' | \
		grep -v -e '\*' | \
		xargs -r grep -l -e "error '1234567890'" | \
		rest_of_pipe

Asking xargs to report on its limits:

	$ echo path/* | \
		tr ' ' '\n' | \
		xargs --show-limits grep -e I_do_not_want_output
	Your environment variables take up 2174 bytes
	POSIX lower and upper limits on argument length: 2048, 1046528
	Maximum length of command we could actually use: 1044354
	Size of command buffer we are actually using: 34942

Everything should be up to date.  cygcheck.out is attached.  Let me know
if you want any other information.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 23249 bytes
Desc: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20061208/0d48b667/attachment.obj>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list