HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)
c
csh(1) csh(1)
NAME
csh - a shell (command interpreter) with C-like syntax
SYNOPSIS
csh [-cefinstvxTVX
][command_file ][argument_list ]...
DESCRIPTION
csh is a command language interpreter that incorporates a command history buffer, C-like syntax, and job
control facilities.
Command Options
Command options are interpreted as follows:
-c Read commands from the (single) following argument which must be present. Any remain-
ing arguments are placed in argv.
-e C shell exits if any invoked command terminates abnormally or yields a non-zero exit
status.
-f Suppress execution of the .cshrc file in your home directory, thus speeding up shell
start-up time.
-i Force csh to respond interactively when called from a device other than a computer ter-
minal (such as another computer). csh normally responds non-interactively. If
csh is
called from a computer terminal, it always responds interactively, regardless of which
options are selected.
-n Parse but do not execute commands. This is useful for checking syntax in shell scripts. All
substitutions are performed (history, command, alias, etc.).
-s Take command input from the standard input.
-t Read and execute a single line of input.
-v Set the verbose shell variable, causing command input to be echoed to the standard out-
put device after history substitutions are made.
-x Set the echo shell variable, causing all commands to be echoed to the standard error
immediately before execution.
-T Disable the tenex features which use the ESC key for command/file name completion and
CTRL-D for listing available files (see the CSH UTILITIES section below)
-V Set the verbose variable before .cshrc is executed so that all .cshrc commands
are also echoed to the standard output.
-X Set the echo variable before .cshrc is executed so that all .cshrc commands are
also echoed to the standard output.
After processing the command options, if arguments remain in the argument list, and the -c,
-i, -s,or
-t options were not specified, the first remaining argument is taken as the name of a file of commands to
be executed.
COMMANDS
A simple command is a sequence of words, the first of which specifies the command to be executed. A
sequence of simple commands separated by vertical bar (|) characters forms a pipeline. The output of each
command in a pipeline becomes the input for the next command in the pipeline. Sequences of pipelines can
be separated by semicolons (;) which causes them to be executed sequentially. A sequence of pipelines can
be executed in background mode by adding an ampersand character (&) after the last entry.
Any pipeline can be placed in parentheses to form a simple command which, in turn, can be a component of
another pipeline. Pipelines can also be separated by || or && indicating, as in the C language, that the
second pipeline is to be executed only if the first fails or succeeds, respectively.
Jobs
csh associates a job with each pipeline and keeps a table of current jobs (printed by the jobs command)
and assigns them small integer numbers. When a job is started asynchronously using &, the shell prints a
line resembling:
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 1−−129