Subject: Re: CONTINUING Elementary Problems with Find
From: [email-masked] (Weiqi Gao)

22 Oct 1997 22:59:43 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

GBradfor wrote:
> 
> Thanks to all who responded to my first post.  Yes, indeed, it was the
> Windows version of find that was causing my problem.  However,
> correcting this problem has revealed another.  Again, it is probably
> newbie in nature, but your assistance is appreciated.
> 
> Taking my initial command line:
>   find . -name *.c -print
> 
> gives the following error:
>   find:  Paths must precede expression
>   Usage:  find [path...] [expression]

Watch out for the shell, because the shell has the first stab at the
command line.  If you are using the Windows 95 COMMAND.COM shell, then
*.c gets expanded to:
  i) a list of your .c files in the current directory; --OR--
  ii) if there are no .c files in the current directory, *.c

As a consequence, find will see different things depending on how many
..c files you have in the directory.  The command line that find will see
will be:
  i) find . -name a.c -print (if a.c is the only .c file in the current
directory)
  ii) find . -name a.c b.c -print (if a.c and b.c are the .c files in
the current directory)
  iii) find . -name *.c -print (if there are no .c files in the current
directory)
  iv) a command line similar to ii) when more than two .c files exist in
the current directory

You will get the result that you expecte in cases i) and iii).  You will
get the error message that you cited in cases ii) and iv).

> Just to check things out, I got into bash and checked my pwd
> (/gnu_src/cdk/winsup), and I entered this absolute address into the
> command line.  No luck, same error.

When in find, parse as the shells do.

--
Weiqi Gao
[email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".