The C-Shell


 

Overview

The shell allows us to give commands to Unix and interprets them for us. It takes care of expanding any wildcards before a command is executed. This takes the responsibility for providing wildcard interpretation away from the application programmer and guarantees consistency between programs. [Have you wondered why in MS-DOS (MicroSoft Disk Operating System), DIR *.* works but TYPE *.* does not?]

Shells also provide other facilities to make the life of the user easier, such as command histories. In this part of the course we shall explore some of these facilities.

The default shell, on many Unix systems, is the C Shell, so called because its commands have a similar syntax to the C programming language. Other shells include the Bourne shell, (the original Unix shell) and an enhanced version of this, the Korn shell. The default shell on OUCS Unix systems is the tcsh, very similar to the C Shell but with added facilities. Although each shell differs in the facilities that they offer, their behaviour when carrying out routine tasks is essentially the same.

Each shell is simply an executable program and can be called up by name. On OUCS Unix systems:

Bourne shell
/bin/sh
C Shell
/bin/csh
tcsh
/usr/local/bin/tcsh
Korn shell
/bin/ksh
Bourne Again SHell
/usr/local/bin/bash

Each time you login to a Unix system your default shell will be run. To find out which shell you are using type the command echo $SHELL, to view the current value of the shell variable, SHELL (see Environment Variables).

Note, you can reset your default login shell by typing the command chsh. You will be prompted for a choice of a new default login shell.

Help: for more information see csh(1), or sh(1), ksh(1), bash(1), tcsh(1) depending on the shell being used.