Welcome to the Dictionary of Programming Languages, a compendium
of computer coding methods assembled to provide information and
aid your appreciation for computer science history.
Browse the dictionary by clicking on a section:
Get a full dump of the dictionary:
List of Names
- Language type:
Csh is an interpreted command and scripting
language designed and implemented as part of
the BSD Unix development effort.
It was primarily designed as an interactive
command language, but is also widely used
to automate system administration and
software development tasks in Unix
Csh supports only one
primitive data type:
strings. Csh has arithmetic operators
treat strings as integers in some constructs.
Like other Unix shell language, csh
has two scopes for variables: local and
All local variables in a csh program have the
same data type: a vector of strings.
All environment (exported) variables have
the same data type, string, as required
Statements in csh are normally delimited
by line boundaries, but semicolons may
also be used.
Control flow constructs supported by Csh
include if-then-else, two kinds of loops,
goto, a case statement, and a very
simple interrupt handling statement. All
of the flow control constructs, as well as
the expression syntax, are modeled
after those in the C programming language.
Unlike most other programming language,
csh has no explicit syntax for subroutines.
Instead, each separate csh source file can
be treated as a kind of subroutine.
Csh is available on essentially all Unix
and related operating systems.
Despite its wide use, good tutorials on
C shell programming are not widely
available on the web. Good books on
shell programming are available.
- See Also:
An advanced variant of csh, called the
Twenex csh (tcsh) is also very popular.
Tcsh supports the same programming
features as its parent csh, but provides
special interactive use features.
Csh is one of the most contentious of the
differences between the two main camps of
the Unix world. The "System V" camp
espouses general use of the Bourne shell
(sh) and its derivatives such as the
Korn shell (ksh). The "Berkeley" camp
espouses general use of the C shell and
its derivatives. In the 1990s this debate
became largely moot because all the popular
shells became available on all Unix
Csh and its cousin tcsh are primarily
interactive command interpreters; they
can and have been used for programming,
though, even when much faster and simpler
solutions existed (e.g. sh, awk, perl).
While csh provides a fair set of program
flow constructs, it does not provide very
good I/O facilities or controls. This
is perceived as a major failing by many
Unix cognescenti. For more information about
csh's shortcomings, check out the
famous 'csh programming considered harmful'
article (link below).
For serious Unix scripting, csh has been
superseded by Perl.
- Sample code:
# A simple csh script to find a command on
# the directories listed in the environment
# variable PATH, and print out information
# about it.
if ("$cmd" == "") then
echo "Usage: findcmd commandname"
foreach dir ($path)
if (-x "$check" && ! (-d "$check")) then
ls -ldg $check
set cnt=$cnt 1
if ($cnt == 0) then
echo "Sorry, command $cmd not found."
Descriptions in this dictionary are ©1997-99 Neal Ziring. Some
examples copyright of their respective authors. Some
technologies and languages are trademarked. Permission to
copy descriptions is granted as long as authorship credit is preserved.
Comments on this dictionary, corrections and suggestions, are all welcome.
Please use email, the address is firstname.lastname@example.org
[Ziring MicroWeb Home]
Dictionary and script maintained by Neal Ziring, last major modifications 3/18/98. Most recent
additions to dictionary and master list, 1/00.