According to "help read":
    Options:
-n nchars return after reading NCHARS characters rather than waiting
                for a newline, but honor a delimiter if fewer than NCHARS
                characters are read before the delimiter

    Exit Status:
The return code is zero, unless end-of-file is encountered, read times out, or an invalid file descriptor is supplied as the argument to -u.

If read is invoked with the -n or -N options, then given an EOF, it returns with a zero exit status.

In addition, if it is invoked with -n 3, for example, then given EOF for one of the first 2 characters, it still waits for all 3 characters.

I am running the most recent Arch (up to date as of 7/26/13) on a 64-bit machine.
Arch package version: 4.2.045-4
$BASH_VERSION: 4.2.45(2)-release

Is it possible that this can be fixed? Any suggestions for a work-around if it can't?

Peter Olson


Reply via email to