[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: read -t 0 fails to detect input.

From: Bize Ma
Subject: Fwd: read -t 0 fails to detect input.
Date: Thu, 19 Dec 2019 19:07:45 -0400

To: Chester Ramey <address@hidden>

On thu., dec. 19 of 2019 at 12:40, Chet Ramey (<address@hidden>) wrote:

> On 12/18/19 6:40 PM, Bize Ma wrote:

> >>> The exit status is 0 if input is available on the specified file
> >   descriptor, non-zero otherwise.
> Bash-5.0 uses select/FIONREAD to determine whether or not there is input
> available on the file descriptor. Those don't wait; they test whether or
> not there is input on the specified file descriptor at the point they are
> called.

Thanks Chet.

Could you please comment about this assertions:

 1.-   bash will either do a select() or an ioctl(FIONREAD), or neither of
them, but not both, as it should for it to work. read -t0 is broken. Do not
use it – mosvy.
 2.- Conclusion: read -t0 is *broken* in bash. Don't use it. –
<https://unix.stackexchange.com/users/308316/mosvy> mosvy

reply via email to

[Prev in Thread] Current Thread [Next in Thread]