16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

sh<br />

and this second shell actually runs command. In this way, command runs in<br />

a completely separate execution environment; it can change working<br />

directories, change variables, open files, and so on without affecting the first<br />

shell. The child shell’s environment begins as a copy of the current<br />

environment, so the value of the ENV environment variable is not run when<br />

achild shell starts.<br />

| Creates a pipe between the two commands that the | operator<br />

connects.The standard output is the first command becomes the standard<br />

input of the second command. A series of commands connected by pipes is<br />

called a pipeline.The exit status is that of the last command in the pipeline.<br />

&& Is the logical AND operator. The shell runs the second command if and only<br />

if the first command returns a true (zero) exit status.<br />

|| This is the logical OR operator. The shell runs the second command if and<br />

only if the first command returns a false (nonzero) exit status.<br />

& Runs the command that precedes it asynchronously. The shell just starts<br />

the command running and then immediately goes on take new input, before<br />

the command finishes execution. On systems where asynchronous<br />

execution is not possible, this operation is effectively equivalent to ;.<br />

|& Runs the command that precedes it as a co-process.The command runs<br />

asynchronously, as with the & operator, but the command’s standard input<br />

and standard output are connected to the shell by pipes. The shell sends<br />

input to command’s standard input with the print –p command, and reads<br />

from command’s standard output with the read –p command. The<br />

command should not buffer its output. Because of this and other limitations,<br />

co-processes should be designed to be used as co-processes. On systems<br />

where asynchronous execution is not possible, co-processes are not<br />

supported.<br />

; Is the sequential execution operator. The second command is run only after<br />

the first command has completed.<br />

newline<br />

The unescaped newline is equivalent to the ; operator.<br />

Reserved-Word <strong>Command</strong>s<br />

The shell contains a rich set of reserved-word commands, which provide flow of<br />

control and let you create compound commands. In the following list, a command<br />

can also be a sequence of commands separated by newlines. Square brackets ([ ])<br />

indicate optional portions of commands, and are included as part of the command<br />

syntax except in the case of [[ test_expr ]], where square brackets are part of the<br />

command.<br />

! The exclamation point is the logical NOT command. When its operand is<br />

false (nonzero), this command returns true (zero). When its operand is true<br />

(zero), this command returns false (nonzero).<br />

{command;}<br />

Enclosing a command in braces is similar to the (command) construct,<br />

except that the shell runs the command in the same environment rather<br />

than under a child shell. { and } are reserved words to the shell. To make it<br />

possible for the shell to recognize these symbols, you must put a blank or<br />

newline after the {, and a semicolon or newline before the }.<br />

552 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!