External lib unittests: they're killin me!

H. S. Teoh hsteoh at quickfur.ath.cx
Thu May 23 10:47:25 PDT 2013


On Thu, May 23, 2013 at 01:43:52PM -0400, Jonathan M Davis wrote:
> On Thursday, May 23, 2013 13:12:53 Steven Schveighoffer wrote:
> > >> No, the shell expands wildcards, not the OS.
> > > 
> > > It was just a sarcastic comment about incredible consistency of
> > > wildcard expansion in linux.
> > 
> > Having the expansion of wildcards built into the OS would be bad. I
> > don't need to get into that.
> 
> Agreed. Globbing is a shell thing, so it makes sense that the shell do
> it. It has nothing to do with the OS. Saying that it had anything to
> do with OS would be like saying that the fact that you had to escape (
> was a feature of the OS.  It would make no sense. All of that sort of
> thing is a feature of the shell.  Programs just operate on the
> arguments that they're given and it just so happens that the shell
> provides some useful ways for the user to provide larger lists of
> files without typing them all. The OS has no business being involved
> in that.
[...]

This reasoning breaks down when the program needs two or more large
argument lists. On Windows/MSDOS, you could do things like "rename
*.jpeg *.jpg" and it would do the right thing, but this is an utter PITA
on Linux: mv doesn't support it, and even a program that *does* support
it requires escaping to prevent shell interpolation, thus requiring
infelicities like "mv \*.jpeg \*.jpg".

I stand by my statement that wildcards should be handled by the program,
not the shell.


T

-- 
A mathematician is a device for turning coffee into theorems. -- P. Erdos


More information about the Digitalmars-d mailing list