Adding Unicode operators to D

Bill Baxter wbaxter at gmail.com
Fri Oct 24 22:23:05 PDT 2008


On Sat, Oct 25, 2008 at 2:09 PM, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:
> "Bill Baxter" wrote
>> On Sat, Oct 25, 2008 at 1:40 PM, Steven Schveighoffer
>> <schveiguy at yahoo.com> wrote:
>>> "Benji Smith" wrote
>>>> Bill Baxter wrote:
>>>>> Benji Smith wrote:
>>>>>> The key is to never never never use the cygwin shell. It's a piece of
>>>>>> garbage. But using the executables from the "cygwin\bin" directory
>>>>>> within
>>>>>> the windows shell... Priceless!
>>>>>
>>>>> Oh, I didn't realize that.  There is one thing that doesn't work,
>>>>> which is probably what gave me the impression it was broken -- Windows
>>>>> paths with wildcards don't work.   Like "grep c:\Windows\*.txt".   But
>>>>> you're right that it does seem to work for both windows paths, and
>>>>> local wildcards, just not Windows paths with wildcards.
>>>
>>> It's not the paths with wildcards that is the problem.  In this case, it
>>> is
>>> the shell.  Grep is expecting the shell to expand the wildcards, as it
>>> does
>>> on unix.
>>
>> Read again.  Particularly this part:
>>
>> "it does seem to work for both windows paths, **and local wildcards**,
>> just not Windows paths with wildcards".
>> (emphasis added)
>>
>> "grep Foo *.txt"  works just fine.  "grep Foo c:\*.txt"  does not.
>
> Then that must be something grep is doing extra.

Yep, that was what I said.

> Or perhaps the Windows
> console selectively expands wildcards?  I have no idea.

Don't think so.   "echo *" still dutifully prints a "*" to the
console.  Cygwin grep is doing it, probably in an attempt to be more
useful when used from the DOS prompt.

> It seems weird that
> grep would expand only current-directory wildcards (try grep Foo *, and see
> if it works.

Yep that works.

> Windows normally only expands *.* to mean 'all files').

If by that you mean Windows command line programs usually expand *.*, then yeh.

> But in the case of using a cygwin shell, the shell expands all wildcards before
> passing arguments to grep.  That much I do know.  I haven't really had a
> need to use the windows shell in a long time ;)

Yep that's true for Bash.

An easy way to tell the Windows shell does nothing is by compiling and running:

import std.stdio;
void main(string[] args) {  writefln("Args: %s", args); }

And passing it some wildcards.  It never expands anything.  Only thing
it does do is mess with quotes some.  Here's an example:

C:\> args.exe * "C:\Program Files" *.* c:\*
Args: [args,*,C:\Program Files,*.*,c:\*]

--bb


More information about the Digitalmars-d-announce mailing list