switch

NAME

switch - evaluates expression and transfers control, depending on result

SYNOPSIS

switch (string)
...
case str1: 
...
breaksw
...
default:
...
breaksw
endsw

DESCRIPTION

This command is a C-shell built-in command.

Each case label is successively matched, against the specified string that is first command and file-name expanded. The file metacharacters *, ?, and [...] can be used in the case labels, which are variable expanded. If none of the labels match before a 'default' label is found, the execution begins after the default label. Each case label and the default label must appear at the beginning of a line. The command breaksw causes execution to continue after the endsw. Otherwise, control can fall through case labels and default labels, as in C. If no label matches, and there is no default, execution continues after the endsw.