Linked by Eugenia Loli on Mon 20th Mar 2006 07:13 UTC
General Unix After receiving several comments to his November 2005 article on hating UNIX, David Chisnall offers his responses and further insight on his continuing disdain.
Thread beginning with comment 105992
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[5]: Shell Globing
by Vanders on Mon 20th Mar 2006 16:07 UTC in reply to "RE[4]: Shell Globing"
Vanders
Member since:
2005-07-06

To be fair, I'm not trying to fix anything. If I personally really felt that file globing was a big problem, Syllable wouldn't be using bash and I'd have written a different shell that doesn't do automatic globing. There are generally workarounds to most problems; you've provided plenty of examples of scripts that can do mv operations on complex filesets.

What bothers me is the argument "That's the way UNIX has always done it so it can't ever be wrong". Globing is mearly a simple example of this.

P.S: O.K, so "mv *.foo *.bar" isn't syntactically correct if you're running a Bourne-like shell. Nor does "mv *.foo .bar" make much sense and .bar could be a directory anyway. Your suggestion of having a special purpose "rename" command isn't right either; now you have two commands "mv" to move files and "rename" to rename them and the user needs to know what the difference is.

Perhaps my real beef is that the Bourne shell syntax is not expressive enough. Or perhaps it's the fact that traditionally, UNIX commands are non-interactive so can not gracefully handle ambigious cases. Perhaps the problem only exists in my head and everything is just peachy. Although I'd rather be talking about these sorts of things than taking the absolute position that UNIX is the evolutionary be-all and end-all of Operating System design.

Reply Parent Score: 3

RE[6]: Shell Globing
by Ookaze on Mon 20th Mar 2006 17:40 in reply to "RE[5]: Shell Globing"
Ookaze Member since:
2005-11-14

There are generally workarounds to most problems

There start the misunderstanding : these are not workarounds, these are the correct way to deal with the problem, AKA one of the solutions.

What bothers me is the argument "That's the way UNIX has always done it so it can't ever be wrong". Globing is mearly a simple example of this

And there lies another misunderstanding. The argument is not that at all, the argument is "UNIX has been thought out but people keep coming, that without having studied anything about Unix and its command line, come with solutions full of design problems, worse than what we have now".
Saying globing is wrong, when it lays on years of studies of automata design and logic, that you learn in CS courses, is amazing to me. Especially since globing works so well.
At least, the author of the original troll seems to know Unix.

P.S: O.K, so "mv *.foo *.bar" isn't syntactically correct if you're running a Bourne-like shell

Wrong again, it's syntactically correct, it just is not gramatically correct (with the mv command) if .bar is not a directory. Then the shell won't complain, mv will.

Nor does "mv *.foo .bar" make much sense and .bar could be a directory anyway

Again, it makes sense, and will work as long as .bar is a directory.

Your suggestion of having a special purpose "rename" command isn't right either; now you have two commands "mv" to move files and "rename" to rename them and the user needs to know what the difference is

Knowing your tool. That's what I talked about earlier. Man is there for a reason.
Like I said earlier too, the problem here is not the tool, it's a bad understanding of regular expression : a beginner's classic mistake.

Perhaps my real beef is that the Bourne shell syntax is not expressive enough. Or perhaps it's the fact that traditionally, UNIX commands are non-interactive so can not gracefully handle ambigious cases

What do you mean ? Of course they can. You're starting a course on automata or what ? That's precisely the kind of things that automata try to solve, and you can write one in shell if you want (I would not advise you to do that though).

Reply Parent Score: 1

RE[7]: Shell Globing
by Vanders on Mon 20th Mar 2006 19:42 in reply to "RE[5]: Shell Globing"
Vanders Member since:
2005-07-06

Wow. You've managed to reply to my post without ever reading it. You havn't even the slightest understanding of the small out-of context parts of my post that you've quoted. NIce work.

Heres the executive summary for you:

1) I never said globbing was bad.
2) I never said "mv *.foo *.bar" was wrong as it is currently implemented
3) I never said "mv *.foo .bar" was wrong either.
4) It boggles my mind that anyone could think having two tools that do only slightly different things could be a good idea.
5) UNIX tools are not traditionally interactive.
6) You've completly flown off the handle and entirely missed the point of the article, the arguments raised within, my reply and no doubt, this reply as well.

Well done. You qualify for your UNIX beard and certificate of "Approaching Computing as a Purely Academic Excercise".

Reply Parent Score: 2

RE[8]: Shell Globing
by Ookaze on Tue 21st Mar 2006 09:06 in reply to "RE[7]: Shell Globing"
Ookaze Member since:
2005-11-14

1) I never said globbing was bad.
2) I never said "mv *.foo *.bar" was wrong as it is currently implemented
3) I never said "mv *.foo .bar" was wrong either


Of course not, you just said "if the globing were somewhere both the shell and the application could access it and control it's behavour, commands such as "mv *.foo *.bar" would actually have a chance of working".
Except that "mv *.foo *.bar" and "mv *.foo .bar" work.

4) It boggles my mind that anyone could think having two tools that do only slightly different things could be a good idea

Look who will talk about "Purely Academic Excercise" later. In the real world, people make other tools that make slightly different things, but are more specific, like mv and rename.

5) UNIX tools are not traditionally interactive

Like ed/ex, terminals ? Most are not, yes. I doubt that's a tradition.

6) You've completly flown off the handle and entirely missed the point of the article, the arguments raised within, my reply and no doubt, this reply as well

You just failed to explain how, like a good troll.

Well done. You qualify for your UNIX beard and certificate of "Approaching Computing as a Purely Academic Excercise"

And again, like a good troll, you forgot conveniently that I said I use the shell practically in my work.

Reply Parent Score: 1

RE[6]: Shell Globing
by Sheld on Mon 20th Mar 2006 19:54 in reply to "RE[5]: Shell Globing"
Sheld Member since:
2005-12-21

It's not so much that it's "the way it has always been" as it is that there is a good reason for things to be the way they are, and if you don't fully understand how file globing works and why it is the way it is, then you may think that something is wrong with it.

If something was wrong with the way it works and if some other way had clear advantages it would have been fixed a long time ago, the Unix world is not that conservative.

Reply Parent Score: 1

RE[7]: Shell Globing
by Vanders on Mon 20th Mar 2006 20:59 in reply to "RE[6]: Shell Globing"
Vanders Member since:
2005-07-06

Well I'd disagree to a certain extent. UNIX is pretty conservative about these things. That's why it's still fundementally the same OS it was 35 years ago.

As the author of the original article points out, when globbing was implemented as part of the shell it was a good idea. These days, perhaps it isn't. Maybe things could be made more flexible if globing wasn't built into the shell.

As it happens, this is one of those things that just can't change. It's baked right into the design. Not performing globing before passing the arguments to the executable would break pretty much everything; applications would need to be re-written to perform the globing themselves and expand the raw shell arguments, and that clearly isn't going to happen.

What's been really amazing is that a simple reply to make the simple point that perhaps a design decision made over 30 years may not be the best design today has erupted into a long thread about the merits of globing, something that I happen to care very little about in the grand scheme of UNIX design. Even if I don't think it's much of a problem, it's amazing to see that many people arn't even willing to consider the possibility that it could be done better today.

Reply Parent Score: 2