Variables

There are two types of variables: shell variables and environment variables. Shell variables are available only to the shell in which they are defined. Environment variables are available to the current shell and also to other processes (including subshells) that are started from the shell. By convention, shell variables are lowercase and environment variables are uppercase.

Some useful shell variables are listed in the table below.

Variable

Description

autologout

If set, automatic logout occurs after you have been inactive for an hour. If set to a number, logout occurs after that many minutes of inactivity. Some shells set autologout by default at login time. To disable, unset autologout in ˜/.cshrc.

cdpath

A list of directories in which the shell looks for directories specified as arguments to cd or pushd.

correct

If set to cmd, turns on spelling correction for command names. If set to all, turns on spelling correction for the entire command line (tcsh only).

cwd

Set by the shell to your current working directory when your directory changes.

fignore

A list of filename suffixes. Filenames ending with any of the suffixes are ignored for filename completion.

filec

In csh, turns on filename completion. (Unnecessary for tcsh.)

history

If set, specifies the number of commands to save in the history list.

home

The pathname to your home directory.

ignoreeof

If set, CTRL-D does not terminate the shell. You need to explicitly type exit or logout.

mail

Pathname of file to check periodically to see if ...

Get Using csh & tcsh now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.