recursive grep
Steve DeJarnett
steve at polyslo.CalPoly.EDU
Wed Aug 23 07:04:43 AEST 1989
In article <122979 at sun.Eng.Sun.COM> williamt at sun.UUCP (William A. Turnbow) writes:
>Here is a short quicky (I hope). I am trying to do the following:
>
>find . -type d -exec grep string {}/* \;
If you're trying to grep for a string in every file in or below the
current directory, why not do this:
find . -type f -exec grep string {} \;
>However, find apparently does not expand the braces unless they are
>separated by spaces. I've tried a variety of quotes and backslashes,
>but no go.
I suspect that find "sees" the /* after the braces, and presumes
that you mustn't really want it to expand the filename there. I've never
known find to need a space between the braces, but, then, that certainly
doesn't mean that it never would expect that. :-)
-------------------------------------------------------------------------------
| Steve DeJarnett | Smart Mailers -> steve at polyslo.CalPoly.EDU |
| Computer Systems Lab | Dumb Mailers -> ..!ucbvax!voder!polyslo!steve |
| Cal Poly State Univ. |------------------------------------------------|
| San Luis Obispo, CA 93407 | BITNET = Because Idiots Type NETwork |
-------------------------------------------------------------------------------
More information about the Comp.unix.wizards
mailing list