[-1c?
@(#)$Id: read (AT&T Research) 2014-07-20 $
]
[+NAME?read - read a line from standard input]
[+DESCRIPTION?\bread\b reads a line from standard input and breaks it into fields using the characters in value of the \bIFS\b variable as separators.  The escape character, \b\\\b, is used to remove any special meaning for the next character and for line continuation unless the \b-r\b option is specified.]
[+?If there are more variables than fields, the remaining variables are set to empty strings.  If there are fewer variables than fields, the leftover fields and their intervening separators are assigned to the last variable.  If no \avar\a is specified then the variable \bREPLY\b is used.]
[+?When \avar\a has the binary attribute and \b-n\b or \b-N\b is specified, the bytes that are read are stored directly into \bvar\b.]
[+?If you specify \b?\b\aprompt\a after the first \avar\a, then \bread\b will display \aprompt\a on standard error when standard input is a terminal or pipe.]
[+?If an end of file is encountered while reading a line the data is read and processed but \bread\b returns with a non-zero exit status.]
[A?Unset \avar\a and then create an indexed array containing each field in the line starting at index 0.]
[C?Unset \avar\a and read  \avar\a as a compound variable.  Equivalent to \b-aksh\b]
[a?Unset \avar\a and then create an indexed array containing each field in the line starting at index 0.]
[d]:[delim?Read until delimiter \adelim\a instead of to the end of line.]
[p]:[prompt?Write \aprompt\a on each line before reading.  In earlier releases \b-p\b caused the input to come from the current co-process.  Use \b-u p\b instead.  For backward compatibility, if there is a co-process active and \aprompt\a is a valid identifier, then \aprompt\a will be treated as an argument and it will read from the co-process instead of using \aprompt\a as the prompt.]
[r?Do not treat \b\\\b specially when processing the input line.]
[s?Save a copy of the input as an entry in the shell history file.]
[S?Treat the input as if it was saved from a spreadsheet in csv format.]
[u]:[fd:=0?Read from file descriptor number \afd\a instead of standard input. If \afd\a is \bp\b, the co-process input file descriptor is used.]
[t]:[timeout?Specify a timeout \atimeout\a in seconds when reading from a terminal or pipe.]
[n]#[count?Read at most \acount\a characters.  For binary fields \acount\a is the number of bytes.]
[N]#[count?Read exactly \ancount\a characters.  For binary fields \acount\a is the number of bytes.]
[v?When reading from a terminal the value of the first variable is displayed and used as a default value.]

[var?prompt] [var ...]

[+EXIT STATUS?]{
[+0? Successful completion.]
[+>0?End of file was detected or an error occurred.]
}
[+SEE ALSO?\bprint\b(1), \bprintf\b(1), \bcat\b(1)]
