From: Earnie B. <ear...@ya...> - 2002-10-18 13:39:43
|
Sternbach, William [IT] wrote: > Greg, > > When using the MSYS grep to search subdirectories under > the current directory: > > Example: > grep -r WaitForInputIdle *.h (does not work) I beg to differ, it works as designed. > grep -r WaitForInputIdle **/*.h (works) As Joerg pointed out, it's the shell that does the expansion, ** is the same as one * and only globs one level deep. It doesn't even find the *.h in the working directory. > > How did you ever think of trying **/*.h? > I would never have thought of trying that in 1 million years. > ls **/*.h is the same as ls */*.h. > Can someone fix this wierd bug in grep? > It's working as designed, I don't see a "wierd bug", what you want is new functionality. > Is grep a stable utility, or is it filled with bugs? > It's the same grep as is being used on Linux, so Linux grep would have the same bugs. What you want to do is more like find . -type f -name \*.h -exec grep -Hn foo {} \; Earnie. |