Subject: Re: Asterisk expansion...
From: [email-masked] (Earnie Boyd)

27 Jul 1998 19:00:06 -0700
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: Fergus Henderson <[email-masked]>
Cc: gw32 <[email-masked]>

---Fergus Henderson <[email-masked]> wrote:
>
> On 24-Jul-1998, Earnie Boyd <[email-masked]> wrote:
> > ---"Robertson, Jason V"  wrote:
> > >
> > > Hi,
> > > 
> > > There seems to be an inconsistency in how * is interpreted. 
When you
> > > run, say, 'echo.exe' from the commandline you get the following:
> > > C:> echo *.*
> > > <Contents of C: are listed>
> > > C:> echo \*.\*
> > > \*.\*
> > > 
> > > So why does it expand the glob in the first instance, and not
unescape
> > > them in the second?
> > 
> > It is the shells job to do the globbing not the programs.
> 
> Then why does gnu-win32 do the globbing in the case of the command
> `echo *.*'?

In the case of the DOS shell command `ECHO' or `echo' is a shell
builtin; therefore, gnu-win32 doesn't even enter the picture.  In the
case of the bash shell command `echo' is a shell builtin and globbing
happens as expected.  Yes, I know there is an echo.exe; but, unless
you explicitely execute it you execute the builtin command.

To answer your question though, gnu-win32 globs the command line again
so that the filesystem emulation can happen rather seamlessly.

You responded to Michael Hirmke:
> No; he is assuming that gnu-win32 should use \ to escape characters.
> After all, it is gnu-win32 that is doing the globbing (expanding the
> wildcards), not command.com or cmd.exe.

This is an incorrect statement due to the first fact I stated.  When
doing `echo \*.\*' within the DOS shell the globbing that occurs
within cmd.exe or command.com will not find a file and then returns
\*.\* to echo as the parameter list which it will simply write to stdout.
==
-        \\||//
---o0O0--Earnie--0O0o----
[email-masked]
------ooo0O--O0ooo-------

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

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