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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Options<br />

Examples<br />

In general, a single IFS character marks the end of one field and the beginning of<br />

the next. For example, if IFS is colon (:), read considers the input a::b to have<br />

three fields: a, an empty field, and b. However, if IFS contains blanks, tabs or<br />

escaped newlines, read considers a sequence of multiple blanks, tabs, or escaped<br />

newlines to be a single field separator. For example, "a b" has two fields, even<br />

though there are several blanks between the a and b.<br />

The nth variable in the command line is assigned the nth field. If there are more<br />

input fields than there are variables, the last variable is assigned all the unassigned<br />

fields. If there are more variables than fields, the extra variables are assigned the<br />

null string ("").<br />

The environment variable REPLY is assigned the input when no variables are<br />

given. The exit status of read is 0, unless it encounters the end of the file.<br />

–p Receives input from a coprocess.<br />

–r Treats input as raw data, ignoring escape conventions. For example, read<br />

–r does not interpret a final backslash (\) as a line continuation character,<br />

but as part of the input.<br />

–s Adds input to the command history file as well as to the variables specified<br />

with variable.<br />

–u[d] Reads input from the single-digit file descriptor d, rather than from the<br />

standard input. The default file descriptor is 0.<br />

When the first variable parameter has the form:<br />

variable?prompt<br />

it defines a prompt for input. If the shell is interactive, read sends the prompt to the<br />

file descriptor d if it is open for write and is a terminal device. The default file<br />

descriptor for the prompt is 2.<br />

IFS=’:’<br />

while read name junk junk1 junk2 junk3<br />

do<br />

echo $name<br />

done

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

Saved successfully!

Ooh no, something went wrong!