30 November 2011
Why you should not use C shell
Before POSIX shells became generally available, many people used the C shell as their interactive shell. It has a number of features that were lacking in the Bourne shell, including arithmetic and command history. However, when it comes to writing scripts, it has many drawbacks.
The best-known argument against
is Tom Christiansen's article,
Programming Considered Harmful
In the first of those articles, he expands on these 10 problems:
- The Ad Hoc Parser
- Multiple-line quoting difficult
- Quoting can be confusing and inconsistent
- If/while/foreach/read cannot use redirection
- Getting input a line at a time
- Aliases are line oriented
- Limited file I/O redirection
- Poor management of signals and sub-processes
- Fewer ways to test for missing variables
- Inconsistent use of variables and commands.
Since, as Bruce says in the first of the above
articles, "UNIX was hard enough to learn, and spending
months to learn two shells seemed silly", I recommend
using a Bourne-type interactive shell, and I specifically
The only reason to use
csh is to maintain
existing code, and even then, I'd recommend converting it to a
It will save you time and headaches in the long run.
If you really do need help with a
Bruce's csh page.
Modified 28 Mar 2013