Read one line of standard input and assign each word (as defined by IFS) to the corresponding
variable, with all leftover words assigned to the last variable. If only one variable is specified, the entire line is assigned to that variable. The return status is 0 unless
EOF is reached, a distinction that is useful for running loops over input files. If no variable names are provided, read the entire string into the environment variable
Read each word into an element of
var, which is treated as an array variable.
Stop reading the line at
char instead of at the newline.
Line editing and command history are enabled during input.
num characters from the line.
Display the prompt
string to the user before reading each line, if input is interactive.
Raw mode; ignore \ as a line continuation character.
Don't echo the characters entered by the user (useful for reading a password).
Time out and return without setting any variables if input is interactive and no input has been entered for
Read input from specified file descriptor
fd instead of standard input.
read first last addressSarah Caldwell 123 Main Street $
echo "$last, $first\n$address"Caldwell, Sarah 123 Main Street
The following commands, which read a password into the variable
$user_pw and then display its value, use recently added options that are not in all versions ...