Adding Unicode operators to D

Benji Smith dlanguage at benjismith.net
Sat Oct 25 01:00:43 PDT 2008


Bill Baxter wrote:
>>> "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.

Interesting.

About 90% of the time, I run grep with the "recursion" flag, so I 
haven't thought about wildcard expansion in ages.

   grep -R "some text" .

I do know that "wc" does wildcard expansion, even with paths, but you 
have to use forward slashes. So, to count lines in D programs from the 
windows shell:

   wc -l /dev/*.d

Unfortunately, there's no "recursion" flag for wc, so I end up doing 
something dumb like this:

   wc -l /dev/*.d
   wc -l /dev/*/*.d
   wc -l /dev/*/*/*.d

Etc.

Hmmmmmm. I really should just compile my own wc. After all, Walter's 
already written the sample code.

--benji


More information about the Digitalmars-d-announce mailing list