A well-known pamphlet by Tom Christiansen devoted to the position that scripting in /bin/csh must be considered harmful. Part of the Unix FAQ.

In the Unix newsgroups, comp.unix.shell in particular, this continues to be a frequent topic, and I've seen a couple of postings on the matter with useful additions or better wordings of the main points. But if this pamphlet isn't going to convince you, there's little hope that anything else will.

Many prospective scripters get lured by the C in csh. They may already have seen the hopeless pile of garbage that /bin/sh syntax seems to be, and may expect the C-shell to be 'more like C', that is, more like a real programming language.

Well, don't let appearance fool you: it isn't. Superficially, csh's syntax is C-like, but underneath, it is much further from C than the shell it tried to improve on. csh doesn't even have a proper parser, so it's doubtful if it can be said to have a syntax at all. Most of csh's constructs break down on further scrutiny: they are inadequate, or only applicable in certain very specific contexts, or outright buggy. By contrast, /bin/sh constructs, while awkward on the surface, do hold up under scrutiny: they are consistent and orthogonal and form a genuine scripting language.

Don't script in csh. Not if I'm ever going to have to use that code. Thank you.

Log in or register to write something here or to contact authors.