Notice! This document is currently in Archived status.
The content of this document may be incorrect or outdated.

Print this article Edit this article

C Shell Predefined Shell Variables

Purdue Engineering Computer Network
Variables can be set in one of two ways, by assigning a value:

set var=value

or by simply turning them on:

set var

In the table below, variables that accept values are shown with the equal sign followed by the type of value they accept; the value is then described. The C shell automatically sets the variables argv, cwd, home, path, prompt, shell, status, term, and user.

argv=(args)		List of arguments passed to current command:
default is ().
cdpath=(dirs) List of alternate directories to search when locating
arguments for cd, popd, or
pushd.
cwd=dir Full pathname of current directory
echo Re-display each command line before execution; same
as csh-x command.
fignore=(chars) List of filename suffixes to ignore during filename
completion (see filec).
filec If set, a filename that is partially-typed on the
command line can be expanded to its full name when
ESC is pressed. If more than one filename would match,
type EOF to list possible completions.
hardpaths Tell dirs to display the actual
pathname of any directory that is a symbolic link.
histchars=ab A two character string that sets the characters to
use in history-substitution and quick-substitution
(default is !^).
history=n Number of commands to save in history list.
home=dir Home directory of user, initialized from HOME.
The ` character is shorthand for this value.
ignoreeof Ignore an end-of-file (EOF) from terminals; prevents
accidental logout.
mail=(n file) One or more files checked for new mail every 5 minutes
or (if n is supplied) every n
seconds.
nobeep Don't ring bell for ambiguous file completion (see
filec).
noclobber Don't redirecto output to an existing file;
prevents accidental destruction of files.
noglob Turn off filename expansion; useful in shell scripts.
nonomatch Treat filename metacharacters as literal characters.
notify Notify user of completed jobs right away, instead of
waiting for the next prompt.
path=(dirs) List of pathnames in which to search for commands to
execute. Initialized from PATH.
prompt='str' String that prompts for interactive input; default
is %.
savehist=n Number of history commands to save in ~/.history
upon logout; they can be accessed at the next login.
shell=file Pathname of the shell program currently in use.
Default is /bin/csh.
status=n Exit status of last command. Built-in commands return
0 (success) or 1 (failure).
term=ID Name of terminal type, initialized to /etc/ttytype,
same as TERM.
time='n %c' If command execution takes more then n CPU
seconds, report user time, system time, elapsed
time, and CPU percentage.
user=name Login name of user, initialized from USER.
verbose Display a command after history substitution; same
as the command csh -v.

Last Modified: Dec 19, 2016 11:12 am US/Eastern
Created: Aug 22, 2007 12:49 pm GMT-4 by admin
JumpURL: