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: Robert Elz
Subject: Re: bash sockets: printf \x0a does TCP fragmentation
Date: Sun, 23 Sep 2018 08:55:11 +0700

    Date:        Sat, 22 Sep 2018 14:22:19 -0600
    From:        Bob Proulx <bob@proulx.com>
    Message-ID:  <20180922111950901701520@bob.proulx.com>


  | Primarily a shell script is a command and control program.  It is very
  | good for that purpose.  It is typically used for that purpose.  That
  | is the mainstream use and it is very unlikely one will run into
  | unusual situations there.
  |
  | But programming tasks that are much different from command and control
  | tasks, such as 

I completely agree with all of that - shells should be used for running other
programs, which do the actual work, and only in the most simplistic of cases
actually doing stuff themselves.

This kind of explosion is what destroyed perl as a useful tool - as originally
created by Larry Wall it was very useful, combining the power of string 
manipulation with regular expressions (for which sed would have been used
previously) with the field splitting a floating point calculations from awk,
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 possible
to write evenything in whatever is their favourits programming language, and
added networking ability (including the ability to format packets of course),
and others added threading, and others object orientation, and now all that's
left is a giant mess.

Every attempt should be made to resist shells moving in the same direction.


  | > I doubt you can judge on this by just looking at a single line
  | > 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 "bs=" (which simply does read write with
a buffer that size) but "obs=" which reads (using ibs if needed, which it
would not be here), copies to an output buffer and writes only when that
buffer is full (or on EOF on the input).




reply via email to

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