[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: bash sockets: printf \x0a does TCP fragmentation
From:       Chet Ramey <chet.ramey () case ! edu>
Date:       2018-09-25 13:46:55
Message-ID: faaed40d-d4af-5c2e-0cfe-c2c7db89eecd () case ! edu
[Download RAW message or body]

On 9/25/18 9:04 AM, dirk+bash@testssl.sh wrote:

> FYI: I ended up checking with type before whether an external printf
> exists and set a variable for this and then just call this variable.
> 
> env or exec: never thought about it (thanks!) but as both are external
> commands, that would mean upon every call one additional external program.
> (yes, I know that there is such thing as a fs buffer). Subshells also costs
> resources. As this is a core function I am happy for every homeopathic dose
> of time I safe here :-)

`exec' is a shell builtin. It will `cost' in terms of a fork, but you're
going to fork and exec a different program anyway -- /usr/bin/printf --
so it's basically a wash. In either case, there's one fork and one
execve.

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic