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.

Table 27. Shell Operators (sh command) (continued)<br />

Unary Operators<br />

Additive Operators<br />

+ − Addition, subtraction<br />

Bitwise Shift Operators<br />

> Bitwise shift right, bitwise shift left<br />

Relational Operators<br />

< > Less than, greater than<br />

= Less than or equal, greater than or equal<br />

= = != Equal to, not equal to<br />

Bitwise AND/OR Operators<br />

& AND<br />

^ Exclusive OR<br />

| Inclusive OR<br />

Logical AND/OR Operators<br />

&& Logical AND<br />

|| Logical OR<br />

? : If-else<br />

Assignment Operator<br />

= *= /= %=<br />

+= −= = &= ^= |=<br />

Assignment<br />

You do not need the $(( )) syntax to enclose an arithmetic expression in these<br />

situations:<br />

v In assignment to an integer variable. (See typeset.)<br />

v As an argument to the following built-in shell commands:<br />

break exit return continue let shift<br />

v When used as arguments in the test built-in shell command numeric<br />

comparisons (–eq, –ge, –gt, –le, –lt, and –ne). See test.<br />

<strong>Command</strong> Substitution<br />

In command substitution, sh uses the expansion of the standard output of one<br />

command in the command line for a second command. There are two syntaxes.<br />

The first syntax (called backquoting)surrounds a command with grave accents `, as<br />

in:<br />

ls `cat list`<br />

To process this command line, sh first runs the cat command and collects its<br />

standard output. The shell then breaks this output into arguments and puts the<br />

result into the command line of the ls command. The previous command therefore<br />

lists the attributes of all files, the names of which are contained in the file list.<br />

This syntax is easy to type, but is not useful if you want to put one command<br />

substitution inside another (nesting command substitutions). A more useful syntax<br />

is:<br />

sh<br />

Chapter 2. Shell command descriptions 563

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

Saved successfully!

Ooh no, something went wrong!