This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Asterisk expansion...








---Fergus Henderson <fjh@cs.mu.OZ.AU> wrote:
>
> On 24-Jul-1998, Earnie Boyd <earnie_boyd@yahoo.com> 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----
--earnie_boyd@yahoo.com--
------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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]