MPE/iX Shell and Utilities Reference Manual, Vol 2

sh(1) MPE/iX Shell and Utilities sh(1)
|& executes the command that precedes it as a co-process. The command runs asynchro-
nously, as with the & operator, but command’s standard input and standard output
are connected to the shell by pipes. The shell sends input to command’s standard
input with the print –p command, and reads from command’s standard output with
the read –p command. The command should not buffer its output. Because of this
and other limitations, co-processes should be designed to be used as co-processes.
On systems where asynchronous execution is not possible, co-processes are not sup-
ported.
; is the sequential execution operator. The second command is executed only after the
first command has completed.
<newline>
the unescaped newline is equivalent to the ; operator.
The shell contains a rich set of reserved word commands which provide flow of control and let
you create compound commands. In the following list, a command can also be a sequence of
commands separated by newlines. Italic square brackets ([]) indicate optional portions of
commands, and are never part of the command syntax.
! command
The exclamation point is the logical
NOT command. When its operand is false (non-
zero), this command returns true (zero). When its operand is true (zero), this com-
mand returns false (non-zero).
{ command;}
Enclosing a command in braces is similar to the (command) construct except that
the shell executes the command in the same environment rather than under a sub-
shell. { and } are simply reserved words to the shell. To make it possible for the
shell to recognize these symbols, you must put a blank or newline after the {, and a
semicolon or newline before the }.
case word in
[(][pattern[|pattern] ...)command ;;] ...
[(][pattern[|pattern] ...)command ;;] ...
esac
The case statement is similar to the switch statement of the
C programming lan-
guage or the case statement of Pascal. If the given word matches any one of the
patterns separated by or-bar (|) characters, sh executes the corresponding command.
The patterns should follow the rules given in File Name Generation except that the
period (.) and slash (/) are not treated specially. Patterns are matched in the order
they are given, so more inclusive patterns should be mentioned later. You must use
the double semicolon (;;) to delimit command and introduce the next pattern.
Commands and Utilities 1-523