Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Robert Elz Newsgroups: gnu.bash.bug Subject: Re: read -t 0 fails to detect input. Date: Thu, 19 Dec 2019 08:39:28 +0700 Lines: 43 Approved: bug-bash@gnu.org Message-ID: References: <21436.1576719568@jinx.noi.kre.to> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1576719602 6684 209.51.188.17 (19 Dec 2019 01:40:02 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: Bize Ma Envelope-to: bug-bash@gnu.org In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2001:3c8:9009:181::2 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <21436.1576719568@jinx.noi.kre.to> X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:15754 Date: Wed, 18 Dec 2019 19:40:45 -0400 From: Bize Ma Message-ID: | 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