csh(1)

csh(1)

NAME

 

csh - a shell (command interpreter) with C-like syntax

 

SYNOPSIS

 

csh [-cefinstvxTVX] [ command_®le ] [ argument_list

... ]

DESCRIPTION

csh is a command language interpreter that incorporates a command history buffer, C-like syntax, and job control facilities.

c

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 ®le 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/®le name completion and

 

CTRL-Dfor listing available ®les (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 -toptions were not speci®ed, the ®rst remaining argument is taken as the name of a ®le of commands to be executed.

COMMANDS

A simple command is a sequence of words, the ®rst of which speci®es 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 ®rst 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 Release 11i: December 2000

− 1 −

Section 1129