Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15759 > unrolled thread

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

Started byMartin Schulte <gnu@schrader-schulte.de>
First post2019-12-20 08:57 +0100
Last post2019-12-20 08:57 +0100
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Fwd: read -t 0 fails to detect input. Martin Schulte <gnu@schrader-schulte.de> - 2019-12-20 08:57 +0100

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

FromMartin Schulte <gnu@schrader-schulte.de>
Date2019-12-20 08:57 +0100
SubjectRe: Fwd: read -t 0 fails to detect input.
Message-ID<mailman.1176.1576828683.1979.bug-bash@gnu.org>
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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web