bug-bash
[Top][All Lists]
Advanced

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

Re: bash sockets: printf \x0a does TCP fragmentation


From: Chet Ramey
Subject: Re: bash sockets: printf \x0a does TCP fragmentation
Date: Wed, 26 Sep 2018 10:00:57 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 9/26/18 2:17 AM, Dirk Wetter wrote:

>> then what happens if "$data" is
>> a paragraph of text with embedded newlines.  In that case,
>> it sounds like bash might break apart the single printf
>> output into smaller packets rather than transmitting the
>> entirety of "$data" in 1 write (presuming it is less than
>> the maximum data size for a network packet).
> 
> yup.
> 
> Wonder why the coreutils printf behaves (in my sense) better
> than the bash-builtin.

The answer's the same as it was last week: because bash line-buffers
stdout and stderr, which it has done since early 1992.

-- 
``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/



reply via email to

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