Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Reply-To: From: "Dan Higgins" To: Subject: RE: Broken since 1.3.10, or earlier Date: Wed, 17 Jul 2002 13:10:33 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal In-Reply-To: <3D34E085.4040600@DeFaria.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 > -----Original Message----- > From: Andrew DeFaria [mailto:Andrew AT DeFaria DOT com] > Sent: Tuesday, July 16, 2002 10:12 PM > To: cygwin AT cygwin DOT 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/