|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
|
The C shell (csh) is a Unix shell developed by Bill Joy for the BSD Unix system. It was originally derived from the 6th Edition Unix /bin/sh (the Thompson shell), the predecessor of the Bourne shell. What is important is that its syntax is modeled after the C programming language and as such it was much closer to scripting language that shell from Borne shell family.
The C shell added many feature improvements over the Bourne shell, such as aliases and command history. Today, the original C shell is not in wide use on Unix; it has been superseded by other shells such as the Tenex C shell (tcsh). Tcsh replaced csh as the default shell on FreeBSD. The letter "t" in tcsh comes from the T in TENEX, an operating system which inspired Ken Greer, the author of tcsh, with its command-completion feature. Ken Greer worked on tcsh in the late 1970s at the Carnegie Mellon University. Paul Placeway from Ohio State University continued work on it in the 1980s, and since then it has been maintained by numerous people. Wilfredo Sanchez, the former lead engineer of Mac OS X, worked on tcsh in the early 1990s at MIT. Early versions of Mac OS X shipped with tcsh as the default shell, but it has since been replaced by bash.
A modernized variant of C shell for Windows was written by Nicole Hamilton and called Hamilton C shell.
The program in C shell (C shell script) has Fortran-style structure: each line of input (or line of a script file) is interpreted as a separate command to execute, with backslashes "escaping" newlines where needed (so that multiple input lines can comprise a single command to be executed.
C-shell has two features that make it closer to traditional Algol-style languages:
set a = b"
rather than Bourne shell's "a=b".It has some ambiguites due to precenden of operators:
if ( ! -e foo ) echo bar > foo
It would appear to say "if file 'foo' does not exist, create it with contents 'bar'". But it will in fact create an empty file, as the line is parsed such that the output redirect is set up before the file existence is tested. (These and other criticisms do not, however, apply to the more-modern Hamilton C shell variant of the csh language.)
Copyright © 1996-2007 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Last modified: February 28, 2008