Hamilton LaboratoriesHamilton C shell 2012User guideLanguage reference

All variables

Oregon Coast

Combined list of predefined variables
Previous | Next


Combined list
See also



An environmental variable. Environmental variables are passed to any child processes or windows you create by invoking an external utility or application.


A shell variable shared by all threads. If one thread makes a change, all will see it.


Each thread gets its own copy but the initial value is inherited from its parent.


Each thread gets its own copy but the initialization is always to a defined value.

Combined list

Name Default Use

A synonym for the processid variable when typed as $$.


A synonym for the argv variable when typed as $*.


A synonym for the getline variable when typed as $<.


A synonym for the stmtnumber variable when typed as $@.

ADDITIONS Bright white on green

Lines added found by diff.


Any argument words passed to the shell or to a .csh script file.

ASCIICONVERT Bright yellow

ASCII files which received line end conversions by tar.

bsdargv 0

If set, $argv[0] contains the name of the script, just as it would under the original Berkeley C shell; by default, $argv[0] is the first argument word.

bsdhistory 0

By default, !! is the immediately preceding command and !-1 is the one before that. Setting bsdhistory = 1 makes them the same.

cdhome 0

If set, the cd command with no argument is the same as cd $home. Default is to simply print the current directory name.


Current disk, not including the colon.


Same as cdisk, returning the current disk, but in upper case.


List of directories to search for the subdirectory specified as the new current directory.

cdpath null

Same as the CDPATH environmental variable, broken into words.

chgdisk 0

If set, cd automatically changes the current disk if the path is on another disk.

child 0

Identification number of the last child process spawned.


Normal screen colors. If it's not set, the C shell inherits the color settings of the console window when it starts.

The colors available in the C shell are black, red, green, yellow, blue, magenta (or blue red), cyan (or blue green) and white. Foreground colors may also be bright, dim, blink or reverse.

The optional keyword on introduces background colors. All the names of the colors along with the keywords bright, dim, blink, reverse and on may be in upper, lower or mixed case.

Blink causes true blinking only full-screen; in a text window, it just makes the background brighter.


Usually, this is the pathname of cmd.exe. If you set it to point to the C shell, e.g., so other programs will invoke the C shell rather than cmd.exe, the C shell will try to look through the search path for cmd.exe if it needs to run a .cmd file.


Default set of command line options to be pasted ahead of any other command line options passed to csh.exe.


Template for the title bar. Setting it to a null string causes the title bar inherited at startup to be displayed. Unsetting it causes “Hamilton C shell” to be displayed. Other values will be evaluated for command and variable substitutions the same way the prompt variables are interpreted.


Same as the CSHTITLE environmental variable.


Full pathname of the current directory.

DELETIONS Bright white on red

Lines deleted found by diff.


Directories listed by ls.


Used by du, pwd and vol and in drive wildcarding, e.g., *:foo.*, to limit the default list of drives it will report on. Written as a list of alphabetic characters representing the drives you want listed; ranges are allowed, e.g., c-e. If you don’t define this variable, all drives beginning with C: are normally reported.


When filename completion matches more than one name.

echoallinput 0

Copy the input to stdout as it’s read. Similar to echoinput, but inherited from parent to child threads.

echoinput 0

Copy the input to stdout as it’s read. (Similar to echoallinput but not inherited to a child thread.)

eofgetline 0

Pseudo-variable to indicate if the last reference to getline encountered an end-of-file condition.


Character to be interpreted as a literal escape character. Placed in the environment and passed to child processes only if it is not the default circumflex.

escapesym ^

Character to be interpreted as a literal escape character. Same as the ESCAPESYM environmental variable.


Used by tar when listing filetypes in an archive that have no counterparts on Windows.


Read one character from stdin without echoing. If stdin is tied to the keyboard, outboard keys are returned as two-character strings.


Read one line from stdin pseudo-variable. If stdin is tied to the keyboard, keystrokes are echoed as they’re typed.

gotowindow 50

Number of statements a goto can jump over (when not inside a nested block) without being considered an error.


Current disk or directory.

histchars !%

Characters which introduce long-form and short-form history references, respectively.

history 0

Number of statements to remember on the history list; 0 turns off the history mechanism. (If the thread is interactive, history is automatically set to 100.)


Home directory. Default is the initial current directory.


Same as the HOME environmental variable.

ignoreeof 0

If True, don’t exit at EOF on stdin; insist on an exit command.

ignoreerrors 0

Determine whether execution should continue if an error occurs: 0 means the thread exits; 1 (the default for an interactive thread) means exit from loops or procedures and try to read a new command; 2 means ignore all errors.

ignorestatus 1

If True, a non-zero status code from a child process is ignored. Otherwise, it’s an error.

interactive 0

If True, prompt for input.

irqmask 0

Determines whether interrupts are enabled 0, deferred until the mask is cleared again 1 or ignored 2.


Counts the nesting level of this invocation of the C shell for use the in the prompts defined in the default Startup.csh file.


Default set of command line options to be pasted ahead of any other command line options passed to ls.

MATCHFAIL Bright red

When filename or command completion doesn’t match anything.


List of drives and UNC names for which ls, pwd, wildcarding and the fullpath and current directory functions should report filenames in mixed case rather than all lower case. Default is all drives are considered mixed case.


End or top of file in more.

MOREERROR Bright white on red

Unrecognizable command to more.


User response to more prompt.

MOREPROMPT Red on white

Prompt line in more.

MORETOPMEM Bright yellow

Top of Memory message from more.

nohashing 0

Determine how/whether path hashing is done: 0 means full path hashing of the directories on the search path; 1 means turn off hashing completely; 2 means hash only the directories which do not depend on the setting of the current directory.

noclobber 0

If True, don’t allow redirection to overwrite an existing file unless the ! override is given.


A synonym for the nowild variable.

nonohidden 0

Determine whether wildcarding will match against hidden files: 0 means don’t match hidden files; 1 means hidden files will be found.

nonomatch 0

Determine the response to a wildcard that doesn’t match anything: 0 means it’s an error; 1 means pass it through to the application; 2 means simply discard it.

nonovar 0

Determine the response to a reference to a non-existent variable, procedure or alias. Same encoding as nonomatch.

nowild 0

Can only be set to true 1 or false 0. Set to true, it turns off filename wildcarding.


Obsolete name for the WinBuild variable.

nullwords 0

Determines whether an array index off the end of a list is an error 0 or returns a null word 1.


Name of the operating system on which the shell is running. Possible values are Windows NT and Windows 9x.


Search path for executable files as one long string. Each directory on the path is separated from the next by a ;. See also the shell path variable, which has the list of directories parsed into separate words.


Same as the PATH environmental variable, broken into words.

precision 6

Number of decimal places to print when displaying floating point values.


The unique process ID assigned by the Windows kernel to this copy of the C shell.


Primary command prompt template.

prompt1 $@ $CDISK%

Same as PROMPT1 environmental variable.


Continuation line prompt template.

prompt2 $@ $CDISK?

Same as the PROMPT2 environmental variable.


Default radix used by more and other utilities when displaying binary data.


Used by ls and other utilities for directories marked read-only.


Used by ls and other utilities for files marked read-only.

savehist 0

Save the history contents into history.csh in the home directory.


Tells whether this thread is running or called from a script 1 or not 0.


Name of the C shell script file being executed, if any.


Always set to the pathname of the Hamilton C shell csh.exe file.


Same as the SHELL environmental variable.

status 0

Exit code of the last child process.

stmtnumber 1

Autoincremented statement number used with the history list and in prompting.


Characters that can be used as option introducers for the shell and utilities.

SYSTEMDIRS Bright green

Used by ls for directories with the System bit on.


Used by ls for files with the System bit on.


Used by more, head, tail and tabs to tell them how many character positions there are between tab stops.

tailstatus 0

Determines whether the status variable will reflect the reflect the return code from the leftmost or rightmost stage of a pipeline: 0 means leftmost; 1 means rightmost.

TAPE \\.\tape0

Used by mt to specify the pathname of the default tape drive.


Used by tar to identify files, using a list of wildcards, that should be considered as ASCII, regardless of content.


Used by tar to identify files, using a list of wildcards, that should be considered as binary, regardless of content.


Thread id of the currently executing thread.

verbose 0

If true 1, print out all available information when reporting errors.


Build number of the Windows system on which the shell is running, e.g., 7601 for Windows 7.


Version number of the Windows API on which the shell is running, e.g., 6.1 for Windows 7.

See also

@, calc, set, setenv and local
Variable substitution
Substitution modifiers
Predefined environment variables
Predefined shared variables
Predefined inherited variables
Predefined initialized variables
Tutorial: Variables
Tutorial: Editing

Previous | Next

Getting started with Hamilton C shell

Hamilton C shell, as it first wakes up.

Getting started with Hamilton C shell

A first few commands.

You can set the screen colors to your taste.

You can set the screen colors to your taste.