csh , the C shell, is a command
interpreter with a syntax reminiscent of the C language. It provides a
number of convenient features for interactive use that are not available
with the Bourne shell, including filename completion, command aliasing,
history substitution, job control, and a number of built-in commands. As
with the Bourne shell, the C shell provides variable, command and filename
Initialization and Termination
When first started, the
C shell normally performs commands from the .cshrc file in your home directory,
provided that it is readable and you either own it or your real group ID
matches its group ID. If the shell is invoked with a name that starts with
‘-‘, as when started by login(1), the shell runs as a login shell.
If the shell is a login shell,
this is the sequence of invocations: First, commands in /etc/.login are
executed. Next, commands from the .cshrc file your home directory are exe-cuted.
Then the shell executes commands from the .login file in your home directory;
the same permission checks as those for .cshrc are applied to this file.
Typically, the .login file contains commands to specify the terminal type
and environment. (For an explanation of file interpreters, see below “Command
Execution” and exec(2).)
As a login shell terminates,
it performs commands from the .logout file in your home directory; the
same permission checks as those for .cshrc are applied to this file.
After startup processing
is complete, an interactive C shell begins reading commands from the terminal,
prompting with hostname % (or hostname # for the privileged user). The
shell then repeatedly performs the following actions: a line of command
input is read and broken into words. This sequence of words is placed on
the history list and then parsed, as described under USAGE, below. Finally,
the shell executes each command in the current line.
When running noninteractively,
the shell does not prompt for input from the terminal. A noninteractive
C shell can execute a command supplied as an argument on its command line,
or interpret commands from a file, also known as a script.