What version of unix are you using? It was fixed in a patch on HPUX
> -----Original Message----- > From: Kevin Old [SMTP:[EMAIL PROTECTED] > Sent: 09 October 2003 17:22 > To: Dan Muey > Cc: [EMAIL PROTECTED] > Subject: RE: grep argument list too long...how to get around it? > > On Thu, 2003-10-09 at 12:13, Dan Muey wrote: > > > Hello everyone, > > > > Howdy > > > > > > > > We use the Barracuda Spam appliance (barracudanetworks.com) > > > to filter our spam and their web based interface is written > > > in Perl. They have a form that allows the user to search > > > messages for key words. Evidentally it stores the each > > > message in a file in a directory and when trying to search > > > several hundred thousand messages for a word the response back > > > is: > > > > > > egrep: argument list too long > > > > > > > If I was trying to grep a zillion files at once and it wouldn't > > let me I'd probably grep them one at a time. > > For instance via the backtivck execution You might have: > > > > my @matchedfiles = qx(cat `ls /files/` |grep $string); > > # a really bad way to do this but for example's sake... > > > > You could do: > > > > for(`ls /files/`) { > > if(`cat $_ |grep $string`) { push(@matchedfiles,$_); } > > } > > Are you sure about using ls? We have directory here that has several > thousand files in it and when doing an ls *.whatever-extension we always > get an "argument list too long". > > Any idea what the actual file limit is for grep? > > > > > Then you are only greping one file at a time instead of a list of too > many. > > Of course what would be better is to use the readdir() functions to list > the files > > and open() and grep() combo to grep the contents. But the same principle > applies. > > > > Just make sure the barracuda folks says thanks for fixing their problem > :) > > Yeah, we're hoping for a few months of service for free.....:) > > This was also a personal quest to find the answer for myself. So either > way I win. > > Thanks for your help, > Kevin > -- > Kevin Old <[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] ------------------------------------------------------------ The information contained in or attached to this email is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. It may contain information which is confidential and/or covered by legal professional or other privilege (or other rules or laws with similar effect in jurisdictions outside England and Wales). The views expressed in this email are not necessarily the views of Centrica plc, and the company, its directors, officers or employees make no representation or accept any liability for its accuracy or completeness unless expressly stated to the contrary. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]