bug-bash
[Top][All Lists]
Advanced

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

Re: Fwd: read -t 0 fails to detect input.


From: Martin Schulte
Subject: Re: Fwd: read -t 0 fails to detect input.
Date: Fri, 20 Dec 2019 08:57:47 +0100

Hello!

> 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.
>  2.- Conclusion: read -t0 is *broken* in bash. Don't use it. –

No. It works as intended. It's not usable in a pipe in the way you try,
but this is caused by the principles of a pipe, not by a bug in read.

while ! read -t 0; do
  echo 'It works as intended - just press RETURN to see why'
done

Best regards,

Martin



reply via email to

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