Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15754 > unrolled thread
| Started by | Robert Elz <kre@munnari.OZ.AU> |
|---|---|
| First post | 2019-12-19 08:39 +0700 |
| Last post | 2019-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.
Re: read -t 0 fails to detect input. Robert Elz <kre@munnari.OZ.AU> - 2019-12-19 08:39 +0700
| From | Robert Elz <kre@munnari.OZ.AU> |
|---|---|
| Date | 2019-12-19 08:39 +0700 |
| Subject | Re: 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
Back to top | Article view | gnu.bash.bug
csiph-web