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
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.
Read into indexed array array
Read up to first occurrence of delim
, instead of newline. ksh93
Read from the output of a
Raw mode; ignore \ as a line continuation character.
Save input as a command in the history file.
When reading from a terminal or pipe, if no data is entered after timeout
. This prevents an application from hanging forever, waiting for user input. ksh93
Read input from file descriptor n
(default is 0).
Prompt yourself to enter two temperatures:
read n1?"High low: " n2