MPE/iX Shell and Utilities Reference Manual, Vol 2

read(1) MPE/iX Shell and Utilities read(1)
–u[d] reads input from the single digit file descriptor d, rather than from the standard input.
The default file descriptor is 0.
EXAMPLE
while read firstword junk
do
echo $firstword
done </etc/profile
displays the first word of each line of the system profile file.
ENVIRONMENT VARIABLES
The following environment variables affect read:
IFS
contains a string of characters to be used as internal field separators.
PS2
contains the prompt string that an interactive shell uses when it reads a line ending
with a backslash and you did not specify the –r option, or if a here-document is not
terminated after you enter a newline.
REPLY
contains the input (including separators) if you did not specify any variables.
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 Failure due to any of the following:
— end-of-file on input
— invalid variable
— incorrect descriptor specified after –u
— missing co-process
2 Failure due to an invalid command line argument.
Messages
Because this utility is built into the
MPE/iX Shell, see the sh(1) man page for a complete list of
error messages that you may receive when using it.
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0.
read is a built-in command of the Bourne Shell and KornShell on UNIX systems. The Bourne
Shell does not implement parameters of the form variable?prompt, or any options.
The –p, –s, and –u options are extensions to the POSIX standard.
Commands and Utilities 1-479