public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: CONTINUING Elementary Problems with Find
@ 1997-10-22 20:35 Robert Seeger
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Seeger @ 1997-10-22 20:35 UTC (permalink / raw)
  To: GBradfor, gnu-win32

Try:
	find . -name \*.c -print

The shell replaces *.c with all .c files in the directory. You have to use
\*.c to make the shell ignore the * character.

				Hope this helps,
				Robert Seeger

At 09:06 AM 10/22/97 -0500, 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]
>     
>     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.
>     
>     Suggestions?
>     
>     Thanks again for your patience and your help.
>     
>     /s/
>     Pat Bradford
>     
>     Reply to:
>        gbradfor@redstone.army.mil
>                AND/OR
>        p_n_brad@traveller.com
>     
>-
>For help on using this list (especially unsubscribing), send a message to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>
========================================
Robert Seeger
Network Engineer
Bay Networks

Telephone:	(518)237-2087
Pager:		(800)SKY-8888  Pin#1264792
Fax:		(518)237-4190
Email:		rseeger@baynetworks.com
Address:	224 5th Ave, Apt#2
		Lansingburgh, NY 12182
========================================
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CONTINUING Elementary Problems with Find
  1997-10-22  7:51 GBradfor
  1997-10-22 18:52 ` gnu-win32-request
  1997-10-22 22:14 ` Weiqi Gao
@ 1997-10-23 14:42 ` Michael Hirmke
  2 siblings, 0 replies; 8+ messages in thread
From: Michael Hirmke @ 1997-10-23 14:42 UTC (permalink / raw)
  To: gnu-win32

Hi,

[...]
>        find . -name *.c -print
         find . -name "*.c"
>
>     gives the following error:
>        find:  Paths must precede expression
>        Usage:  find [path...] [expression]

If you don't include a "*" into "", it will be expanded by the shell,
which will confuse find.

Btw. -print is obsolete with the GNU versions of find.

[...]
>     Thanks again for your patience and your help.
>
>     /s/
>     Pat Bradford

Bye.
Michael.
--
Michael Hirmke           | Telefon +49 (911) 557999
Georg-Strobel-Strasse 81 | FAX     +49 (911) 557664
90489 Nuernberg          | E-Mail  mailto:mh@mike.franken.de
                         | WWW     http://minimike.franken.de/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CONTINUING Elementary Problems with Find
  1997-10-22 23:44 Colin Peters
@ 1997-10-23  9:23 ` Weiqi Gao
  0 siblings, 0 replies; 8+ messages in thread
From: Weiqi Gao @ 1997-10-23  9:23 UTC (permalink / raw)
  To: 'GNU-Win32'

Colin Peters wrote:
> 
> Weiqi Gao[SMTP:weiqigao@a.crl.com] wrote:
> >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
> 
> Sorry to pick nits, but this is not strictly true. Under Win95
> the startup code of a program gets the command line unaltered
> and performs "globbing" to create the argv list. Most (but not
> all) Win95 programs do the globbing you describe (because
> thats the kind that MS compilers' startup code does). I could
> give you a program that runs under Win95 command.com and
> does not perform globbing.

I stand corrected.

There is still the issue of different shells "glob"s differently,
though.

--
Weiqi Gao
weiqigao@a.crl.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CONTINUING Elementary Problems with Find
@ 1997-10-23  6:10 Earnie Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Earnie Boyd @ 1997-10-23  6:10 UTC (permalink / raw)
  To: GBradfor, ueda; +Cc: gnu-win32

>Date: Thu, 23 Oct 1997 09:58:16 +0900
>From: "=?iso-2022-jp?B?GyRCPmVFRCEhN3JHNxsoSg==?=" 
<ueda@prs.cs.fujitsu.co.jp>
>Reply-To: ueda@prs.cs.fujitsu.co.jp
>To: GBradfor <GBradfor@fhssmtp.redstone.army.mil>
>Cc: gnu-win32@cygnus.com
>Subject: Re: CONTINUING Elementary Problems with Find
>
>Hi, 
>
>>      Taking my initial command line:
>>         find . -name *.c -print
>> 
>>      gives the following error:
>>         find:  Paths must precede expression
>>         Usage:  find [path...] [expression]
>
>The shell have expanded "*.c" into several filenames before execute
>find.
>May be, do you want to do as bellow?
>
>	find . -print | grep '\.c'
>-

NO! To stop shell expansion use quoting:

        find . -name '*.c' -print
                   or
        find . -name "*.c" -print

-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd@hotmail.com-
------ooo0O--O0ooo-------


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: CONTINUING Elementary Problems with Find
@ 1997-10-22 23:44 Colin Peters
  1997-10-23  9:23 ` Weiqi Gao
  0 siblings, 1 reply; 8+ messages in thread
From: Colin Peters @ 1997-10-22 23:44 UTC (permalink / raw)
  To: 'Weiqi Gao'; +Cc: 'GNU-Win32'

Weiqi Gao[SMTP:weiqigao@a.crl.com] wrote:
>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

Sorry to pick nits, but this is not strictly true. Under Win95
the startup code of a program gets the command line unaltered
and performs "globbing" to create the argv list. Most (but not
all) Win95 programs do the globbing you describe (because
thats the kind that MS compilers' startup code does). I could
give you a program that runs under Win95 command.com and
does not perform globbing.

With all this said, your main point is correct. It's probably
the shell (or the startup code) expanding *.c that's messing
him up.

Sorry again,
Colin.

-- Colin Peters - Saga Univ. Dept. of Information Science
-- colin@bird.fu.is.saga-u.ac.jp - finger for PGP public key
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
-- http://www.geocities.com/Tokyo/Towers/6162/

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CONTINUING Elementary Problems with Find
  1997-10-22  7:51 GBradfor
  1997-10-22 18:52 ` gnu-win32-request
@ 1997-10-22 22:14 ` Weiqi Gao
  1997-10-23 14:42 ` Michael Hirmke
  2 siblings, 0 replies; 8+ messages in thread
From: Weiqi Gao @ 1997-10-22 22:14 UTC (permalink / raw)
  To: gnu-win32

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
weiqigao@a.crl.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CONTINUING Elementary Problems with Find
  1997-10-22  7:51 GBradfor
@ 1997-10-22 18:52 ` gnu-win32-request
  1997-10-22 22:14 ` Weiqi Gao
  1997-10-23 14:42 ` Michael Hirmke
  2 siblings, 0 replies; 8+ messages in thread
From: gnu-win32-request @ 1997-10-22 18:52 UTC (permalink / raw)
  To: GBradfor; +Cc: gnu-win32

Hi, 

>      Taking my initial command line:
>         find . -name *.c -print
> 
>      gives the following error:
>         find:  Paths must precede expression
>         Usage:  find [path...] [expression]

The shell have expanded "*.c" into several filenames before execute
find.
May be, do you want to do as bellow?

	find . -print | grep '\.c'
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* CONTINUING Elementary Problems with Find
@ 1997-10-22  7:51 GBradfor
  1997-10-22 18:52 ` gnu-win32-request
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: GBradfor @ 1997-10-22  7:51 UTC (permalink / raw)
  To: gnu-win32

     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]
     
     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.
     
     Suggestions?
     
     Thanks again for your patience and your help.
     
     /s/
     Pat Bradford
     
     Reply to:
        gbradfor@redstone.army.mil
                AND/OR
        p_n_brad@traveller.com
     
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1997-10-23 14:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-22 20:35 CONTINUING Elementary Problems with Find Robert Seeger
  -- strict thread matches above, loose matches on Subject: below --
1997-10-23  6:10 Earnie Boyd
1997-10-22 23:44 Colin Peters
1997-10-23  9:23 ` Weiqi Gao
1997-10-22  7:51 GBradfor
1997-10-22 18:52 ` gnu-win32-request
1997-10-22 22:14 ` Weiqi Gao
1997-10-23 14:42 ` Michael Hirmke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).