[manual index][section index]

NAME

read - read from standard input with optional seek

SYNOPSIS

read [ -[eor] offset ] [ count ]

DESCRIPTION

Read does a single read of count bytes (default: 8192 bytes) from the standard input and writes the result to the standard output. If the optional offset argument is given, read will first apply sys-seek(2):

-o offset
seek offset bytes from the start of the file
-e offset
seek offset bytes from the end of the file
-r offset
seek offset bytes from the standard input's current file offset

In all cases the file offset changes to reflect the result of the seek, and the number of bytes read.

SOURCE

/appl/cmd/read.b

DIAGNOSTICS

Read prints a diagnostic and returns a non-empty exit status on an I/O error; it quietly returns status if the read returns zero bytes (conventionally, end of file).

SEE ALSO

cat(1), getline in sh-std(1), stream(1), sys-read(2)

READ(1 ) Rev:  Thu Feb 15 14:42:47 GMT 2007