Home > Online Help > Unix > C Shell: General

C Shell: General

The C Shell Command Interpreter

The Unix shell is a program that accepts commands from a user and calls up programs to perform them. As it is also the only way of calling up programs, the shell effectively surrounds the Unix kernel, which is a special program having exclusive access to the computer hardware (memory, processor, disks, etc.) which other programs need to run.

 Most Unix systems in the world offer users the choice of logging in to one of two shells: (1) the standard shell from Bell Labs, also called the Bourne shell after its author; or (2) the C shell from UC Berkeley, reputed to have a syntax like the C language. The C shell is more convenient for interactive use than the Bourne shell, although it is less efficient for certain applications.

 The C shell provides a variety of very useful services, but not always in a particularly obvious way. This is partly the fault of the shell and partly the fault of the documentation. The ultimate reference consists of the tersely worded manual pages for "csh" (type "man csh" to see them). As most people find this difficult to read, a document called "An Introduction to the C Shell" is also available. Here is a brief list of the C shell's features.

  • History Substitution: allows previous commands to be redone, possibly with changes
  • Job Control: allows programs to be switched from the foreground to the background, putting programs on hold while intermediate results are checked
  • Command Aliases: provides for renaming commands, abbreviating long commands, or turning off selected commands
  • C Shell Programming: has many useful high-level control structures and variable handling capabilities which make conventional programming less attractive
  • Input/Output Redirection: has input/output constructs for diverting input from any file or program and output to any file or program
  • Filename Substitutions: provides for abbreviating groups of files and selecting filenames based on patterns
  • Start Up Processing at Login: provides for commands to be executed automatically on logging in and customization of personal accounts