Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Martin Schulte Newsgroups: gnu.bash.bug Subject: Re: Fwd: read -t 0 fails to detect input. Date: Fri, 20 Dec 2019 08:57:47 +0100 Lines: 19 Approved: bug-bash@gnu.org Message-ID: References: <7e6fccb4-e5b5-eb2b-8b12-eeee9d638ae1@case.edu> <20191220085747.1401a8011f54209747d32617@schrader-schulte.de> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1576828684 28105 209.51.188.17 (20 Dec 2019 07:58:04 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: Bize Ma Envelope-to: bug-bash@gnu.org In-Reply-To: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Received-From: 51.15.128.4 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: <20191220085747.1401a8011f54209747d32617@schrader-schulte.de> X-Mailman-Original-References: <7e6fccb4-e5b5-eb2b-8b12-eeee9d638ae1@case.edu> Xref: csiph.com gnu.bash.bug:15759 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