A truly horrid shell that doesn't even manage 2> redirections properly.

There is a later derivative, tcsh, that is revoltingly popular and marginally better, but it is stilly somewhat silly (as in navig8r's writeup).

Far better choices for login shells include bash and zsh, and, for shell scripting, nothing can beat good, old sh.
Cool! A quick reference for the C Shell!
Notes: Most names of shell variables in CSH are lowercase. This just feels weird for sh people.
Files sourced on login: .login .cshrc /etc/csh.login /etc/csh.cshrc
Files sourced on logout: .logout /etc/csh.logout
History: 'history' command will list your last x commands. x is set with the 'history' shell variable.
Repeat the last entered command: !!
Repeat a command you ran 3 commands ago: !-3
Set an alias: alias dskchk df -k /
Unset an alias: unalias dskchk
< : Standard input
> : Standard output
>& : Standard error (Nope, "2>" won't work.)
>! : override the 'noclobber' option
>&! : Standard output AND Standard error, overriding noclobber.
>> : Append
>>& : Append Standard Error
>>! : Append overriding noclobber
>>&! : Append Standard output AND Standard error, overriding noclobber.
Don't forget about man pages.

This is the genealogy of the programming language csh:

csh is a child of C and sh.
csh was first known as csh in year 1978.
Then it begat Perl in year 1987.

This genealogy is brought to you by the Programming Languages Genealogy Project. Please send comments to thbz.

People don't like csh (and tcsh) for the same reason that a lot of people don't like vi: It doesn't make any sense.

But the truth is that it does make sense, but to quote the movie Labyrinth "you just ain't lookin' at it right." It makes sense in the same way that the "^" key means 'beginging of line" and the "$" character of line in the vi editor, even though $ comes before ^ on the keyboard. You have to look at it from the other way -- In ASCII, ^ comes before $ in their scan values!

Look at it like a programmer would. CSH means 'C' shell. It was written by programmers, for programmers. Everything seems absolutly breain dead when compared to a 'normal' user shell like bash, but in a programmer's mind, many bash conventions seem absolutly pedantic.

Different Shells for different types of users.

But if you really want to piss off some people, make tcsh their defaut shell and have vi be their default line editor!

Well, the man page makes no beef about certain csh facts:

Although robust enough for general use, adventures into the
esoteric periphery of the C shell may reveal unexpected

This is at the very end of the man page, where only the very thourough or the very geeky arrive. It is always worth to read the page to the end, because you may learn surprising truths: a well known example is man perl.

A few notes about the C shell. It is a command line interpreter with C-like syntax that has been a standard part of the Unix operating system since the late 70s.

You don't spell the name of Unix programs in all caps. Use /bin/csh or csh.

Plain csh doesn't have extensive interactive command line editing facilities, but it supports command line completion. It also has history substitution syntax, which can refer back to previously issued commands and specify modifications, even when interactive command line editing is not available - for example, when outpu goes to a line printer, still a common situation in the days when csh was written . This is probably what xunker's writeup refers to.

For interactive use, an extended and bugfixed version of csh, tcsh, is much preferrable. It has extensive command line editing and completion facilities. Similar facilities are available nowadays in the bash and zsh shells.

To pit csh against bash as the programmer's tool of choice is a grave mistake, because it is to programmers that csh reveals its fundamental weaknesses and inferiority to /bin/sh derivatives, of which bash is one. The use of csh for scripting purposes is mostly the result of ignorance and is considered harmful by more experienced users.

This ignorance can be explained by the circumstance that /bin/csh is still the default shell on many Unix systems, especially the commercial and security aware ones. While bash, tcsh and zsh are much more convenient for interactive use, they also represent feature-bloated, untrusted third-party code, and many Unix systems don't provide them for that reason. This leaves csh as the best shell for interactive use, if your other choice is /bin/sh.

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