X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Andrew DeFaria Subject: Re: Inconsistency in find ... -name ... Date: Mon, 15 May 2006 23:10:24 -0700 Lines: 22 Message-ID: References: <051520062206 DOT 6955 DOT 4468FB51000539EF00001B2B22007507440A050E040D0C079D0A AT comcast DOT 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 AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 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/