X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Andrew DeFaria <Andrew@DeFaria.com>
Subject:  Re: Inconsistency in find ... -name ...
Date:  Mon, 15 May 2006 23:10:24 -0700
Lines: 22
Message-ID: <e4bqch$cce$2@sea.gmane.org>
References:  <051520062206.6955.4468FB51000539EF00001B2B22007507440A050E040D0C079D0A@comcast.net>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Thunderbird 1.5.0.2 (Windows/20060308)
In-Reply-To: <051520062206.6955.4468FB51000539EF00001B2B22007507440A050E040D0C079D0A@comcast.net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Eric Blake wrote:
>> Using find, I didn't protect spec in -name (-name 'spec') in a couple of
>> instances but they still worked, viz-a-viz:
>> $ find /home/lowella -type f -name *.h
>> /home/lowella/CVSROOT/src/newlib/doc/ansidecl.h
>> ...
>> whereas a couple of others didn't work, viz-a-viz:
>> $ find /home/lowella -type f -name *.txt
>> find: paths must precede expression
>> Usage: find [-H] [-L] [-P] [path...] [expression]
> echo is your friend. Try:
>
> $ echo /home/lowella -type f -name *.h
>
> And notice that since there are no .h files in the current
> directory, the shell passes the glob through unchanged
> to find. You can also do 'shopt -s nullglob' to change that.
I've wondered about this. Does bash special case the find command then? 
Which other commands does is special case like this?
-- 
Don't tell anyone, but duct tape is The Force. It has a dark side, and a 
light side, and it binds the Universe together.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

