delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/12/12:32:43

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
Date: Wed, 12 May 2004 09:32:24 -0700 (PDT)
From: Kaz Kylheku <kaz AT ashi DOT footprints DOT net>
To: Song Ken Vern-E11804 <E11804 AT motorola DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Behaviour of 'find' under 'bash'
In-Reply-To: <B9D86848C536D411B1D2009027E85170226A0B56@zsg02exm01.corp.mot.com>
Message-ID: <Pine.LNX.4.44.0405120928300.14045-100000@ashi.FootPrints.net>
MIME-Version: 1.0

On Wed, 12 May 2004, Song Ken Vern-E11804 wrote:

> Hi, 
> 
> The find command seems to be behaving differently depending on the content of the current directory. 

Isn't that sort of a design requirement for a search tool? ;)

> drwxr-xr-x+   4 Administ ????????     4096 May 12 08:41 ./
> drwxr-xr-x+  12 Administ ????????     8192 May  6 17:02 ../
> drwxr-xr-x+   2 Administ ????????     8192 May 11 14:06 Code/
> drwxr-xr-x+   4 Administ ????????        0 Mar 24 10:22 XML/
> -rwxr-xr-x+   1 Administ ????????    55022 Apr 20 11:00 XMLParser-rik.java*
> -rw-------    1 E11804   mkgroup-    28367 May 12 08:41 cygcheck.out
> 
> When I issue a : - 
> 
> 08:43$ find ./ -name *.java

You do know that your shell expands the *.java expression before
feeding the resulting command line to the find command?

So you are essentially invoking find like this:

    find . -name XMLParser-rik.java

you are telling find to locate all files which have that exact name.

> 
> But when I issue a :- 
> 
> 08:43$ find ./ -name \*.java

Now you are escaping the wildcard so the shell does not process it. The
find command now receives the pattern and interprets it in the context
of its search.

> It seems like the the shell is substituting '*' with the filename in the current directory. 

You are close. The shell is doing something, indeed. ;)


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

- Raw text -


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