bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [doc] read -t and sockets, devices...


From: Chet Ramey
Subject: Re: [doc] read -t and sockets, devices...
Date: Fri, 13 Jun 2008 18:52:48 -0400
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Stephane Chazelas wrote:

        However, I find that it does have an effect on Unix or
        TCP sockets, on /dev/random and other terminals than
        "the" terminal.


        So maybe a better wording could be: "This option has no
        effect on regular files"?

Thanks, I'll put in something combining those two concepts.


        Also, it may be good to specify that, if the timeout is
        reached, bash will consume the input but will not put
        that consumed input into the variable:

Actually, the bash-4.0 implementation will put the input read into
the specified variable(s), but will still return failure if the timeout
is hit.

I think the best way to differentiate is to clear the variable before
the call, then check the variable afterward.  You can treat the read
as having failed, but still use whatever data was read, if any.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]