Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14666

Re: bash sockets: printf \x0a does TCP fragmentation

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: bash sockets: printf \x0a does TCP fragmentation
Date 2018-09-26 10:00 -0400
Message-ID <mailman.1347.1537970484.1284.bug-bash@gnu.org> (permalink)
References (1 earlier) <20180921231101307758654@bob.proulx.com> <714e1ba0-0052-2f2b-676d-778f2b7129c1@testssl.sh> <20180924130533.4ufaxypoelta6f7n@eeg.ccf.org> <5BAA26C6.10906@tlinx.org> <bdf5d688-a44a-f049-8036-69e853dea7c8@testssl.sh>

Show all headers | View raw


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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: bash sockets: printf \x0a does TCP fragmentation Chet Ramey <chet.ramey@case.edu> - 2018-09-26 10:00 -0400

csiph-web