delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
To: | cygwin AT cygwin DOT com |
From: | Andrew DeFaria <Andrew AT DeFaria DOT 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 DOT 6955 DOT 4468FB51000539EF00001B2B22007507440A050E040D0C079D0A AT comcast DOT net> |
Mime-Version: | 1.0 |
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 |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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 |
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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |