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


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

Re: read -t 0 fails to detect input.

Started byRobert Elz <kre@munnari.OZ.AU>
First post2019-12-19 08:39 +0700
Last post2019-12-19 08:39 +0700
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: read -t 0 fails to detect input. Robert Elz <kre@munnari.OZ.AU> - 2019-12-19 08:39 +0700

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

FromRobert Elz <kre@munnari.OZ.AU>
Date2019-12-19 08:39 +0700
SubjectRe: read -t 0 fails to detect input.
Message-ID<mailman.1121.1576719601.1979.bug-bash@gnu.org>
    Date:        Wed, 18 Dec 2019 19:40:45 -0400
    From:        Bize Ma <binaryzebra@gmail.com>
    Message-ID:  <CAFra36gNku2DTCyivz+caMGnTf7GvGJUTiWicUnBZatcckXGcQ@mail.gmail.com>

  | A little delay seems to get it working:
  |
  | $ echo value | { read -t 0 var; } ; echo $?
  | 0

It might, but that is adding no significant delay, and the
results are unpredictable.

jinx$ echo value | { read -t 0 var; } ; echo $?
0
jinx$ echo value | { read -t 0 var; } ; echo $?
0
jinx$ echo value | { read -t 0 var; } ; echo $?
1
jinx$ echo value | { read -t 0 var; } ; echo $?
1
jinx$ echo value | { read -t 0 var; } ; echo $?
0
jinx$ echo value | { read -t 0 var; } ; echo $?
1
jinx$ echo value | { read -t 0 var; } ; echo $?
1
jinx$ echo value | { read -t 0 var; } ; echo $?
0
jinx$ echo value | { read -t 0 var; } ; echo $?
1
jinx$ echo value | { read -t 0 var; } ; echo $?
0
jinx$ echo value | { read -t 0 var; } ; echo $?
1
jinx$ echo value | { read -t 0 var; } ; echo $?
0

It is all just a race condition - there's nothing specifying which
side of the pipe starts running first.

kre

[toc] | [standalone]


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


csiph-web