47. C Shell Programming...NOTContents:
47.1 Why Not?We use the C shell for many of the interactive examples in this book. History, aliases, and so forth make it far superior to the original Bourne shell for interactive use. (The newer Korn Shell combines features from both. And bash adds even more.) However, csh has some major drawbacks when it comes to shell programming. Tom Christiansen explains some of the reasons in his famous tract "C Shell Programming Considered Harmful," which we've included as article 47.2 . If you find yourself bristling at the tone of this article, remember that it was originally posted to Usenet (1.33 ) . It is an example of that art form known colloquially as a "flame." As flames go, this is actually fairly mild. We agree with most of Tom's criticisms, and make
no attempt to teach C shell programming in this book. We do however
include a few quick-reference style articles on constructs that we
use in articles about the C shell's
setup files (2.2
)
,
since they are in effect nothing but C shell programs read when the
shell starts up. Specifically, we cover the syntax of
if
(47.3
)
and
switch
(47.6
)
statements.
We explain how to set and use C shell
arrays (47.5
)
-
a nice C shell feature that, we admit - , |
|