read
[options] [variable1[?
string]] [variable2 ...]Korn shell only. Same as in the Bourne shell, except that the Korn shell version supports the following options as well as the ?
syntax for prompting. If the first variable is followed by ?
string, string is displayed as a user prompt. If no variables are given, input is stored in the REPLY variable. Additionally, ksh93 allows you to specify a timeout.
-A
arrayRead into indexed array array. ksh93 only.
-d
delimRead up to first occurrence of delim, instead of newline. ksh93 only.
-p
Read from the output of a |&
coprocess.
-r
Raw mode; ignore \ as a line continuation character.
-s
Save input as a command in the history file.
-t
timeoutWhen reading from a terminal or pipe, if no data is entered after timeout seconds, return l
. This prevents an application from hanging forever, waiting for user input. ksh93 only.
-u
[n]Read input from file descriptor n (default is 0).