From owner-freebsd-questions Wed Dec 25 12:21:58 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C52037B401 for ; Wed, 25 Dec 2002 12:21:57 -0800 (PST) Received: from hotmail.com (f3.law15.hotmail.com [64.4.23.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13E7043EC5 for ; Wed, 25 Dec 2002 12:21:57 -0800 (PST) (envelope-from bill_moran2@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 25 Dec 2002 12:20:21 -0800 Received: from 66.132.12.15 by lw15fd.law15.hotmail.msn.com with HTTP; Wed, 25 Dec 2002 20:20:21 GMT X-Originating-IP: [66.132.12.15] From: "Bill Moran" To: shantanoo+fbsd@ieee.org Cc: freebsd-questions@freebsd.org Subject: Re: Argument list too long: limitation in grep? bash? FreeBSD? Date: Wed, 25 Dec 2002 15:20:21 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 25 Dec 2002 20:20:21.0558 (UTC) FILETIME=[0CBA1560:01C2AC53] Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >From: Shantanu Mahajan >+++ Bill Moran [freebsd] [24/12/02 17:25 -0500]: >| Anyway, I'm trying to find the docs on some features that >| the www.php.net's search isn't really helping on (searching >| for __FILE__ doesn't search for __FILE__ ... it searches for >| file, and there's too many results) so I try: >| grep __FILE__ *.html >| and I get the error: >| - -bash: /usr/bin/grep: Argument list too long >| Is this a shortcoming of bash, grep or FreeBSD? I'm assuming >| it's not grep, as the command: >| find . -name *.html -print | xargs grep __FILE__ >| yeilds: >| - -bash: /usr/bin/find: Argument list too long > >try this one > >find . -iname "*.html" -exec grep "__FILE__" {} \; I think the magic in this answer is the quotes around *.html, which (as Greg pointed out) prevent the shell from expanding the wildcard, thus the limit doesn't affect the command. >or maybe you can use "locate" Hadn't thought to try that, although I don't know how it would work. I also didn't want to wait for the locate database to update before doing the search. (although I had to wait for replies from thet list - in the future I won't have to) Thanks for the feedback. -Bill _________________________________________________________________ MSN 8 limited-time offer: Join now and get 3 months FREE*. http://join.msn.com/?page=dept/dialup&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_newmsn8ishere_3mf To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message