[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

System User's Guide: Operating System and Devices


C Shell

The C shell is an interactive command interpreter and a command programming language. It uses syntax that is similar to the C programming language. The csh command starts the C shell.

When you log in, it first searches the systemwide setup file /etc/csh.cshrc. If it is there, the C shell executes the commands stored in that file. Next, the C shell executes the systemwide setup file /etc/csh.login if it is available. Then, it searches your home directory for the .cshrc and .login files. If they exist, they contain any customized user information pertinent to running the C shell. All variables set in the /etc/csh.cshrc and /etc/csh.login files might be overridden by your .cshrc and .login files in your $HOME directory. Only the root user can modify the /etc/csh.cshrc and /etc/csh.login files.

The /etc/csh.login and $HOME/.login files are executed only once at login time. They are generally used to hold environment variable definitions, commands that you want executed once at login, or commands that set up terminal characteristics.

The /etc/csh.cshrc and $HOME/.cshrc files are executed at login time, and every time the csh command or a C shell script is invoked. They are generally used to define C shell characteristics like aliases and C shell variables (for example, history, noclobber, or ignoreeof). It is recommended that you only use the C Shell Built-In Commands in the /etc/csh.cshrc and $HOME/.cshrc files because using other commands increases the startup time for shell scripts.

This section discusses the following:

C Shell Limitations

The following are limitations of the C shell:

Signal Handling

The C shell normally ignores quit signals. Jobs running detached are immune to signals generated from the keyboard (INTERRUPT, QUIT, and HANGUP). Other signals have the values the shell inherits from its parent. You can control the shell's handling of INTERRUPT and TERMINATE signals in shell procedures with onintr. Login shells catch or ignore TERMINATE signals depending on how they are set up. Shells other than login shells pass TERMINATE signals on to the child processes. In no cases are INTERRUPT signals allowed when a login shell is reading the .logout file.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]