9.0;readln, revision 9.0, 85/03/26
READLN -- Set a variable equal to an input value
usage: READLN [-P[ROMPT] prompt] [-ERR[IN]] variable_list
FORMAT
READLN [options] variable_list
The READLN command reads a line of input and sets a variable to that value.
Use the "-P <prompt>" argument to instruct READLN to issue a prompt. READLN
accepts multiple variable names.
The variable type is always a string.
Refer to the descriptions of the READ and READC commands for related
information.
ARGUMENTS
variable_list
(required) Specify the name(s) of the variable(s) that receives the
input value(s). If you specify more than one variable name
(separated by blanks), READLN assigns the values of input
lines to the variables in the order that the variables were
named.
OPTIONS
-P[ROMPT] prompt
Specify a particular prompt string to request the input
value. Enclose the string in single quotes if it contains
literal blanks.
-ERR[IN] Read input from error input instead of standard input.
This option is useful for reading user input from the
Shell's input pad (where error input is normally directed)
when the READLN command appears inside a pipeline, since
standard input in that case is connected to the pipe.
EXAMPLES
Consider the following command line in a Shell script:
READLN -p "Enter total here:" total
In this example, READLN displays the prompt "Enter total here:" in the
process input window, and assigns the value of the input line to the variable
named "total."
RELATED TOPICS
More information is available. Type:
- HELP READC
for information on assigning single-character strings to variables.
- HELP READ
for information on assigning multi-character strings to variables.