Path: csiph.com!goblin3!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Robert Elz Newsgroups: gnu.bash.bug Subject: Re: bash sockets: printf \x0a does TCP fragmentation Date: Sun, 23 Sep 2018 08:55:11 +0700 Lines: 64 Approved: bug-bash@gnu.org Message-ID: References: <20180922111950901701520@bob.proulx.com> <20180921231101307758654@bob.proulx.com> <714e1ba0-0052-2f2b-676d-778f2b7129c1@testssl.sh> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1537672792 20807 208.118.235.17 (23 Sep 2018 03:19:52 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org In-Reply-To: <20180922111950901701520@bob.proulx.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:3c8:9009:181::2 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14641 Date: Sat, 22 Sep 2018 14:22:19 -0600 From: Bob Proulx Message-ID: <20180922111950901701520=40bob.proulx.com> =7C Primarily a shell script is a command and control program. It is v= ery =7C good for that purpose. It is typically used for that purpose. Tha= t =7C is the mainstream use and it is very unlikely one will run into =7C unusual situations there. =7C =7C But programming tasks that are much different from command and cont= rol =7C tasks, such as=20 I completely agree with all of that - shells should be used for running o= ther programs, which do the actual work, and only in the most simplistic of ca= ses actually doing stuff themselves. This kind of explosion is what destroyed perl as a useful tool - as origi= nally created by Larry Wall it was very useful, combining the power of string=20 manipulation with regular expressions (for which sed would have been used= previously) with the field splitting a floating point calculations from a= wk, and the i/o and program cotrol normally found in a shell. Then it was set upon by morons who seem to believe that it must be possib= le to write evenything in whatever is their favourits programming language, = and added networking ability (including the ability to format packets of cour= se), and others added threading, and others object orientation, and now all th= at's left is a giant mess. Every attempt should be made to resist shells moving in the same directio= n. =7C > I doubt you can judge on this by just looking at a single line =7C > of code -- the project has > 18k LoC in bash. That in itself tells me it is probably misguided. While I can imagine tasks that would need that much shell code, they are very very very rare (and most often using auto-generated, and highly repititious, code.)= kre ps: f there was actually a desire to use dd to do re-buffering, the correct usage is not to use =22bs=3D=22 (which simply does read write wit= h a buffer that size) but =22obs=3D=22 which reads (using ibs if needed, wh= ich it would not be here), copies to an output buffer and writes only when that buffer is full (or on EOF on the input).