[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-grep] Re: Grep for Windows bug report
From: |
Stepan Kasal |
Subject: |
Re: [bug-grep] Re: Grep for Windows bug report |
Date: |
Mon, 17 Jan 2005 10:18:01 +0100 |
User-agent: |
Mutt/1.4.1i |
Hi,
On Sun, Jan 16, 2005 at 03:41:05PM +0000, Julian Foad wrote:
> > $ touch a b
> > $ ls * > c
> > $ cat c
> > a
> > b
>
> On Windows, it is different: the wildcard is not expanded by the shell but
> after the application starts, by which time the file "c" exists.
to be more exact, the difference is in shell, not in the OS.
As Arnold pointed out, Bourne style shells expand the wildcard first.
I believe other Unix shells do the same.
So if you have eg. bash for Windows, or any of the shells delivered with
cygwin (bash or other), you probable still get the same behaviour.
But if you use a Windows shell (COMMAND.COM, cmd.exe), then the shell
doesn't expand the wildcards. But it does the redirection.
The Windows compatibility libraries, which is the ported program
linked against, then expand the wildcard before running the main code,
but in that time, file c already exists.
Hope this ``explanation'' doesn't add too much mist.
Stepan Kasal