csh(1)csh(1)

breaksw

Causes a break from a switch, resuming after the endsw.

case label:

A label in a switch statement as discussed below.

cd

cd directory_name chdir

chdir directory_name

Change the shell's current working directory to directory_name. If not speci®ed, directory_name defaults to your home directory.

If directory_name is not found as a subdirectory of the current working directory (and does not begin with /, ./, or ../), each component of the variable cdpath is checked to see if it has a subdirectory directory_name. Finally, if all else fails, csh treats directory_name as a shell variable. If its value begins with /, this is tried to see if it is a directory. See also cd(1).

continue

Continue execution of the nearest enclosing while or foreach. The rest of the commands on the current line are executed.

default:

Labels the default case in a switch statement. The default should come after all other case labels.

dirs Prints the directory stack; the top of the stack is at the left; the ®rst directory in the stack is the current directory.

echo wordlist echo -nwordlist

The speci®ed words are written to the shell's standard output, separated by spaces, and terminated with a new-line unless the -noption is speci®ed. See also echo(1).

else end endif

endsw See the descriptions of the foreach, if, switch, and while statements below.

eval arguments ...

(Same behavior as sh(1).) arguments are read as input to the shell and the resulting command(s) executed. This is usually used to execute commands generated as the result of command or variable substitution, since parsing occurs before these substitutions.

exec command

The speci®ed command is executed in place of the current shell.

exit

exit (expression)

csh exits either with the value of the status variable (®rst form) or with the value of the speci®ed expression (second form).

fg [ %job ... ]

Brings the current (job not speci®ed) or speci®ed jobs into the foreground, continuing them if they were stopped.

foreach name (wordlist)

. . .

end The variable name is successively set to each member of wordlist and the sequence of commands between this command and the matching end are executed. (Both foreach and end must appear alone on separate lines.)

The built-in command continue can be used to continue the loop prematurely; the built-in command break to terminate it prematurely. When this command is read from the termi- nal, the loop is read once, prompting with ? before any statements in the loop are executed. If you make a mistake while typing in a loop at the terminal, use the erase or line-kill character as appropriate to recover.

glob wordlist

Like echo but no \ escapes are recognized and words are delimited by null characters in

HP-UX Release 11i: December 2000

− 3 −

Section 1131

c