Read a line from the standard input and split it into fields.
Reads a single line from the standard input, or from file descriptor FD
if the -u option is supplied. The line is split into fields as with word
splitting, and the first word is assigned to the first NAME, the second
word to the second NAME, and so on, with any leftover words assigned to
the last NAME. Only the characters found in $IFS are recognized as word
delimiters.
If no NAMEs are supplied, the line read is stored in the REPLY variable.
Options:
-a array
[tab]
assign the words read to sequential indices of the array
[tab]
[tab]
variable ARRAY, starting at zero
-d delim
[tab]
continue until the first character of DELIM is read, rather
[tab]
[tab]
than newline
-e
[tab]
use Readline to obtain the line
-i text
[tab]
use TEXT as the initial text for Readline
-n nchars
[tab]
return after reading NCHARS characters rather than waiting
[tab]
[tab]
for a newline, but honor a delimiter if fewer than
[tab]
[tab]
NCHARS characters are read before the delimiter
-N nchars
[tab]
return only after reading exactly NCHARS characters, unless
[tab]
[tab]
EOF is encountered or read times out, ignoring any
[tab]
[tab]
delimiter
-p prompt
[tab]
output the string PROMPT without a trailing newline before
[tab]
[tab]
attempting to read
-r
[tab]
do not allow backslashes to escape any characters
-s
[tab]
do not echo input coming from a terminal
-t timeout
[tab]
time out and return failure if a complete line of
[tab]
[tab]
input is not read within TIMEOUT seconds. The value of the
[tab]
[tab]
TMOUT variable is the default timeout. TIMEOUT may be a
[tab]
[tab]
fractional number. If TIMEOUT is 0, read returns
[tab]
[tab]
immediately, without trying to read any data, returning
[tab]
[tab]
success only if input is available on the specified
[tab]
[tab]
file descriptor. The exit status is greater than 128
[tab]
[tab]
if the timeout is exceeded
-u fd
[tab]
read from file descriptor FD instead of the standard input
Exit Status:
The return code is zero, unless end-of-file is encountered, read times out
(in which case it's greater than 128), a variable assignment error occurs,
or an invalid file descriptor is supplied as the argument to -u.