MPE/iX Shell and Utilities Reference Manual, Vol 2
sh(1) MPE/iX Shell and Utilities sh(1)
positional parameters. sh then displays the value of the variable
PS3
to prompt the
user to enter a numerical reply. If the reply is an empty line, sh displays the menu
again; otherwise, sh assigns the input line to the variable
REPLY
, sets variable to the
word selected, then executes the commands. sh does this over and over until the loop
is terminated by interrupt, end-of-file, or an explicit break(1) statement in the com-
mands.
until command1
do command2
done
The until statement executes command1 and tests its exit status for success (zero)
or failure (non-zero). If command1 succeeds, the loop terminates; otherwise, sh exe-
cutes command2, then goes back to execute and test command1 again. break(1) and
continue(1) commands in the commands can affect the operation of the loop.
while command1
do command2
done
The while statement works similarly to the until statement; however, the loop
terminates whenever command1 is unsuccessful (non-zero exit status).
Shell reserved words are recognized only when they are the unquoted first token of a com-
mand. This lets you pass these reserved words as arguments to commands executed from the
shell. The full list of reserved words is:
!{}
case do done
elif else esac
fi for function
if select then
until while
Command Execution
A simple command consists of three optional parts: arguments, variable assignments, and
redirection. For example,
variable=value argument0 argument1 <filename
is a simple command with one variable assignment, two arguments, and a redirection.
The command is processed as follows:
1. sh performs word expansion on command arguments (see Word Expansion). The
first word of the expanded arguments is the command name. If there are no argu-
ments, sh only performs variable assignments and temporary redirection.
Commands and Utilities 1-525