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


Groups > gnu.bash.bug > #14645

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-23 14:26 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.1180.1537727201.1284.bug-bash@gnu.org> (permalink)
References <c6de6616-dda0-570d-de56-419e7676be8a@cbii-hh.de> <20180921231101307758654@bob.proulx.com> <714e1ba0-0052-2f2b-676d-778f2b7129c1@testssl.sh> <20180922111950901701520@bob.proulx.com>

Show all headers | View raw


On 9/22/18 4:22 PM, Bob Proulx wrote:

> Note that I *did* provide you with a way to do what you wanted to do. :-)
> 
> It was also noted in another message that the external standalone
> printf command line utility did buffer as you desired.  That seems
> another very good solution too.  Simply use "command printf ..." to
> force using the external version.

This won't work the way you want. The `command' builtin only inhibits
execution of shell functions. It still executes builtins.  You want to
either get the full pathname of a printf utility using `type -ap printf'
and use that, or use the env or exec variants I recommended in my last
message.

> 
> Anyway...  Since printf is a text oriented utility it makes sense to
> me that I would operate in line buffered output mode.

It's that bash sets stdout and stderr to be line-buffered, not anything
printf-specific.

-- 
``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-23 14:26 -0400

csiph-web