Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-Id: <5.1.0.14.2.20020712092005.02b97de8@pop3.cris.com>
X-Sender: rrschulz@pop3.cris.com
Date: Fri, 12 Jul 2002 09:25:09 -0700
To: "Glen Cordrey" <gcordrey@convera.com>, <cygwin@cygwin.com>
From: Randall R Schulz <rrschulz@cris.com>
Subject: Re: find -regex not working?
In-Reply-To: <404A59F91E3673418CA27CD122E70F48DF370C@mdpo.convera.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed

Glen,


[ Non-Cygwin-specific question and answer. ]


If you want shell-style (a.k.a., "glob") patterns, use find's "-name" or 
"-iname" options. When you use "-regexp" you need to use full regular 
expressions such as those used by "grep," "egrep," "sed," or Perl.


To get the effect you want, one of these commands is called for:

         find -name "MyFile*"

or

         find -regex "MyFile.*"


Randall Schulz
Mountain View, CA USA


At 09:10 2002-07-12, Glen Cordrey wrote:
>If I understand the find man page, the -regex option isn't working for me.
>
>find -regex 'MyFile.java'
>
>lists the file, but
>
>find -regex 'MyFile*'
>
>doesn't. Am I specifying the regular expression correctly? If so, what 
>else do I need to do for this to work?
>
>Glen Cordrey


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

