Date: Wed, 25 Dec 2002 15:20:21 -0500 From: "Bill Moran" <bill_moran2@hotmail.com> To: shantanoo+fbsd@ieee.org Cc: freebsd-questions@freebsd.org Subject: Re: Argument list too long: limitation in grep? bash? FreeBSD? Message-ID: <F31py6Dfqq5k6J4CDvn000151c5@hotmail.com>
next in thread | raw e-mail | index | archive | help
>From: Shantanu Mahajan <shantanoo+fbsd@ieee.org>
>+++ 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F31py6Dfqq5k6J4CDvn000151c5>
