Reference: read
Author: Daniel Gilly & the Staff of O'Reilly & Associates
Date: 1998-08-06T21:58:52Z

#

| Chapter 4 The Bourne Shell and Korn Shell |

## read

    read variable1 [variable2 ...]

Read one line of standard input, and assign each word to the corresponding `variable`, with all leftover words assigned to last variable. If only one variable is specified, the entire line will be assigned to that variable. See example below and under case. The return status is 0 unless `EOF` is reached.

### Example

>     $ read first last address
>     Sarah Caldwell 123 Main Street
>     $ echo "$last, $first\n$address"
>     Caldwell, Sarah
>     123 Main Street

Reference: r |  | Reference: read