X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: xargs gives grep/gawk too much Date: Sat, 9 Dec 2006 11:31:05 -0800 Message-ID: <0C260F619E428642BFA6380177C3ADF30472ADCC@exmsea005.us.wamu.net> In-Reply-To: <31DDB7BE4BF41D4888D41709C476B65704169472@NIHCESMLBX5.nih.gov> From: "Karr, David" To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id kB9JVrYq031729 If the point of this note is to get your pipeline to work, would it help if you added something like "-n 30" to the xargs command? This should execute one instance of 'grep -l -e "error '1234567890'"' for every 30 lines of output from the previous pipe entry. $ echo path/* | \ tr ' ' '\n' | \ grep -v -e '\*' | \ xargs -r grep -l -e "error '1234567890'" | \ rest_of_pipe > -----Original Message----- > From: cygwin-owner AT cygwin DOT com > [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Buchbinder, > Barry (NIH/NIAID) [E] > Sent: Friday, December 08, 2006 10:05 AM > To: cygwin AT cygwin DOT com > Subject: xargs gives grep/gawk too much > > 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. > -- 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/