10.0;readc, revision 1.0, 88/01/21
readc -- Set variables equal to input characters.
usage: readc [-p[rompt] prompt] [-err[in]] variable_list
DESCRIPTION
The readc command reads single characters as input, and sets a list of
variables equal to those character values. readc parses each character
from the input line as a separate token, and each variable in the list is
assigned the value of a token. Use the -p 'prompt' argument to instruct
readc to issue a prompt.
The readc command considers all input to be type string.
ARGUMENTS
variable_list (required)
Specify the names of the variables that receive the
input values.
OPTIONS
-p[rompt] prompt Specify a prompt string to request the input values.
Enclose the string in single quotation marks 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 readc command appears inside a
pipeline, since standard input in that case is connected
to the pipe.
EXAMPLES
Consider the following sequence of commands and input:
$ readc -p 'Do you want to continue? (y/n): ' ans
Do you want to continue? (y/n): y
$ lvar
string ans = y
In this example, readc displays the prompt "Do you want to continue?
(y/n): " in the process input window, and assigns the value of the first
input character ("y" in this case) to the variable named "ans".
For more information on shell variables, refer to Using your Aegis
Environment.
SEE ALSO
More information is available. Type
help read For information on assigning multicharacter strings to
variables
help readln For information on assigning whole-line strings to
variables