Predefined Shell Variables

Variables can be set in one of two ways; by assigning a value:

    set var=value

or by simply turning the variable on:

    set var

The latter case is useful for simple “Is the variable set?” kinds of tests.

In the following list, variables that accept values are shown with the equals sign followed by the type of value they accept; the value is then described. (Note, however, that variables such as argv, cwd, and status are never explicitly assigned.) For variables that are turned on or off, the list describes what they do when set. tcsh automatically sets (and, in some cases, updates) the variables addsuffix, argv, autologout, command, csubstnonl, cwd, dirstack, echo-style, edit, gid, home, loginsh, logout, owd, path, prompt, prompt2, prompt3, shell, shlvl, status, tcsh, term, tty, uid, user, and version.

addsuffix

Append / to directories and a space to files during tab completion to indicate a precise match.

afsuser

Set value to be used instead of the local username for Kerberos authentication with the autologout locking feature.

ampm

Display all times in 12-hour format.

argv=( args )

List of arguments passed to current command; default is ().

autocorrect

Check spelling before attempting to complete commands.

autoexpand

Expand history (such as ! references) during command completion.

autolist[=ambiguous]

Print possible completions when correct one is ambiguous. If ambiguous is specified, print possible completions only when completion adds no new characters.

autologout=( ...

Get Unix in a Nutshell, 4th Edition 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.