delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/18/19:14:39

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
Message-Id: <5.2.0.9.2.20030118160844.029c2628@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Sat, 18 Jan 2003 16:15:23 -0800
To: "Paul T. Karch" <pkarch AT stargate DOT net>,
"Cygwin General Mail List" <cygwin AT cygwin DOT com>
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: find Exhibits Strange Behavior ?
In-Reply-To: <003501c2bf48$31197e20$a48b28d0@military>
Mime-Version: 1.0

Paul,

Always quote the pattern arguments so they're not expanded by the shell 
before being passed on to "find."

This is just as it is on any ixoid platform.

Shells have options about what to do with glob expressions when no matches 
are present. In BASH it's the "nullglob" option. Not knowing how you have 
it set nor what files exist in the directories where you tried the various 
invocations, it's hard to give a definitive explanation for what you're 
experiencing.

Example:

% shopt -s nullglob
% echo *.glarch

% shopt -u nullglob
% echo *.glarch
*.glarch


Randall Schulz


At 15:20 2003-01-18, Paul T. Karch wrote:
>After I startup with cygwin.bat I am put
>into the /home/user directory.
>If I try to do any of the commands:
>find . -iname *.c
>find  -iname *.c
>find / -iname *.c
>
>I get the following:
>
>find: paths must precede expression
>Usage: find [path...] [expression]
>
>If I enter:
>find *.c
>it works OK, but not recursively
>(as I found out in a 2nd pass on the test).
>
>I made a subdirectory of  "user"; copied some files;
>  and cd'ed to it and entered:
>
>find  . -iname *.c
>
>it works fine.
>
>If  I cd to / and enter
>  find . -iname *.c
>it displays some results, but if I
>cd to usr and issue the same command
>I get more results than I got in the "higher"
>/ directory.  But doesn't this  mean that
>find is not working recursively as it should ?
>
>However under "/" I changed the command to
>find / -iname '*.c'
>and it worked as I expected.  Thus emboldened,
>I cd'ed to ~ and tried   find . -iname '*.c'     and
>it worked fine.
>
>This is not really a problem, I guess, but it is curious.
>Also I may not be interpreting the meaning of the find command
>properly.  Any comments ?
>
>Paul T. Karch


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

- Raw text -


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