Re: AW: Re: read command sometimes misses newline on timeout
From:
Chet Ramey
Subject:
Re: AW: Re: read command sometimes misses newline on timeout
Date:
Sat, 12 Oct 2024 22:41:20 -0400
User-agent:
Mozilla Thunderbird
On 10/7/24 9:49 AM, Thomas Oettli wrote:
I agree with you, but it should never happen that read returns timeout,
also returns the full line and has already read the newline character.
If that happens, there is no way for the script to decide what to do.
I think I found the problem and fixed it. It was possible for read to
read data immediately before the timeout expired, then check for the
timeout before processing the data. It was a very small window, but if
you run it through enough iterations, you could hit it.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/