This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Broken since 1.3.10, or earlier


> -----Original Message-----
> From: Andrew DeFaria [mailto:Andrew@DeFaria.com]
> Sent: Tuesday, July 16, 2002 10:12 PM
> To: cygwin@cygwin.com
> Subject: Re: Broken since 1.3.10, or earlier
>
> Dan Higgins wrote:
> > Greetings,
> >
> > If I want to recursively find all files that contain some text, I use,
> > for example:
> >
> > find . -name '*.java' | while read l; do grep 'Copyright' "$l" && echo
> > "$l";
> > done
>
> Just as an alternative, why not:
>
> $ find . -name '*.java' -exec grep 'Copyright' {}\;

I know that one, but it doesn't give me the file path. My idea behind the
syntax is that I have a bit more flexibility to do some other stuff, since I
know both the line and the path to the file. Of course, if I didn't need to
worry about spaces in pathnames, I'd just use a for loop.

But forget about the syntax for a moment. The real issue here is what *bash*
is doing.

Yep, thanks to Mr. Faylor, I'm convinced that it's a bug in bash. If I run
my syntax through Cygwin's sh it does work perfectly (as it does on any
other Unix bash and MKS sh).

In my experience, issues like this one don't usually mean that there is a
flawed design, but that there may be some "optimization" that requires some
assumptions that aren't always correct. I mention this because it could be
an easy fix to let us "turn off" the optimization.

But, I haven't looked at the source for bash at all, so I could be way off.

Regards,
-Dan


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]