python 2.7.12 on Linux behaving differently than on Windows

BartC bc at freeuk.com
Tue Dec 6 11:41:37 EST 2016


On 06/12/2016 15:44, Michael Torrie wrote:
> On 12/06/2016 04:43 AM, BartC wrote:

> Yes shell expansion has it's gotchas.  But those can all be learned,

Yes, learn to avoid wildcards in command parameters at all costs. But we 
both know that is not satisfactory.

And it's not much help when someone types in:

  program *

and the program has to try and clean up the mess, if it can see it is a 
mess. But remember:

   cp *.c

There might be some irate users out there if it can't detect a simple 
user error like that.

> whereas it's much harder to learn and remember all the gotchas and bugs
> of many individual applications' unique ways of dealing with globs. I'd
> rather deal with shells.
>

OK, I understand. Having a program launcher indiscriminately transform 
input A into A' is /much/ better than having it done by the program, 
even if the program doesn't want it and it is not meaningful.

The fact that you also lose format information (is it three parameters, 
or one parameter transformed into three) is an extra bonus.

This is clearly much better than any other scheme because:

(1) It's Unix not Windows; everything in Unix is always better and 
always make sense.

(2) There have been 40 years of it working this way and there have never 
been any problems. (That is, 40 years of writing programs with 
stultified command line interfaces to make sure that is always the case. 
[As for 'problems' such as the 'cp *.c' one, that's a feature!]

-- 
Bartc


More information about the Python-list mailing list