delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/17/14:08:32

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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: <dan AT danamis DOT com>
From: "Dan Higgins" <DanHiggins AT austin DOT rr DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Broken since 1.3.10, or earlier
Date: Wed, 17 Jul 2002 13:10:33 -0500
Message-ID: <ACEIKCIGAEOGOHGPJPIAMECLCDAA.DanHiggins@austin.rr.com>
MIME-Version: 1.0
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019