grep -r *.java doesn't work as expected

Max Bowsher maxb@ukf.net
Sun Jan 19 17:31:00 GMT 2003


Wai-Yip Tung (wtung) wrote:
> I try to grep all .java file recursively
>
> [/q/Workflow/AppAdmin/src/com/cisco/wf/admin] $ grep -rn systemRsrc
> *.java
>
> Only files in the current directory is searched.
> What's wrong?

Nothing. This is the expected behaviour.
The shell expands *.java, and then runs grep -rn file1.java file2.java
file3.java - none of which are directories, so grep can't recurse into them.

Try:
find -name '*.java' | xargs grep -n systemRsrc

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list