This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: grep -r *.java doesn't work as expected
- From: "Wai-Yip Tung \(wtung\)" <wtung at cisco dot com>
- To: "'Max Bowsher'" <maxb at ukf dot net>, <cygwin at cygwin dot com>
- Date: Tue, 21 Jan 2003 10:39:48 -0800
- Subject: RE: grep -r *.java doesn't work as expected
- Reply-to: <wtung at cisco dot com>
Thank you for all suggestions. I got it works now. I'm new to bash and
the * expansoin by bash kind of surprise me.
Wai-yip
-----Original Message-----
From: Max Bowsher [mailto:maxb@ukf.net]
Sent: Sunday, January 19, 2003 8:27 AM
To: wtung@cisco.com; cygwin@cygwin.com
Subject: Re: grep -r *.java doesn't work as expected
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/