Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Bize Ma Newsgroups: gnu.bash.bug Subject: Fwd: read -t 0 fails to detect input. Date: Thu, 19 Dec 2019 19:07:45 -0400 Lines: 32 Approved: bug-bash@gnu.org Message-ID: References: <7e6fccb4-e5b5-eb2b-8b12-eeee9d638ae1@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1576796892 13219 209.51.188.17 (19 Dec 2019 23:08:12 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=e77WVnV9sq4Zf0Z60FpCBqxadCRqixMD3psTEmdF5TA=; b=MomldJClJCCQ9hRKZwqphCRMg4ggX1T+yViLCmni1shIJD4UBejO86lJ4o46alOuIU QM4jgnS/9rvDXJfcHbN9udag2dklV4pXJIShVzCWYbKuVDnQSBJGAgahcrnIczDwkfXz tUVqRt2g9nwuhKIKRyjOqvll5KhEKM+QUg2HXhI7oXh67XqsOTH/qlgGSqHP8UnZGnqM aLqrGlE7r8KHF/HvZeOhci8RfltBgdIsGErhGRZ5NV61zQsf2kqTqPxEt7QZTS4w+Hq8 KAz2g+XXJ6Dxp2f9uQqm5DgMXpBb7CC30OSf9F0Vz9aSSAgVSAkLpKkbBszyZ7hVIWTY lS9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=e77WVnV9sq4Zf0Z60FpCBqxadCRqixMD3psTEmdF5TA=; b=t3Wv59q2sDLKkOvzIxnsO3iwd2/nX0flxMZGrNMOVmVbozfbuum4DknSOE4/Fjtb7m Plrc7T0MEetmfpk3dYj7OwQlc+9y7vObgfQ73ksSgmnY/FrQ4TBOoPRJJVyIceCNLBie jiqbMpTf1DqBdhY8BP/3npzi3K+JdUznHsHUXhnKPWojddoznGnPYoznGoZEpHlCkewa 80hO8ObKj9wsD1cdyClUHKyc9lMbbnb4QunCL6GoBoxRgUCPZ3lnoOFPdJeXZSqQLRHH YHlhnJil/1JwVQU20a9VAxbp4RAgffs6fxY79oTtPpPYMRmgLSGX2Z4YoofTfPJb5Q+S Y8vA== X-Gm-Message-State: APjAAAWXbhet6a+IDq+BnRIf7kQToJoxv33sgXNBE8RzhP5FQahGNxwU P238DNnZ4ZO27ajfuAIRsVKWW/vOYCVWNoOTaUaexA== X-Google-Smtp-Source: APXvYqxNcMfMv2ubYtpy4+lgRmCFxSsNfs5Q3Su97ehgKZ1r8GGQiiNQ6NiPOxT4PRmhR75zuy1BpPONOkwRyPi6HK4= X-Received: by 2002:aca:f456:: with SMTP id s83mr3000005oih.12.1576796886155; Thu, 19 Dec 2019 15:08:06 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::22a X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: X-Mailman-Original-References: <7e6fccb4-e5b5-eb2b-8b12-eeee9d638ae1@case.edu> Xref: csiph.com gnu.bash.bug:15758 To: Chester Ramey On thu., dec. 19 of 2019 at 12:40, Chet Ramey () wrote= : > On 12/18/19 6:40 PM, Bize Ma wrote: > > >>> The exit status is 0 if input is available on the specified file > > descriptor, non-zero otherwise. > > Bash-5.0 uses select/FIONREAD to determine whether or not there is input > available on the file descriptor. Those don't wait; they test whether or > not there is input on the specified file descriptor at the point they are > called. > Thanks Chet. 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. Do not use it =E2=80=93 mosvy. 2.- Conclusion: read -t0 is *broken* in bash. Don't use it. =E2=80=93 mosvy