[TUHS] A few comments on porting the Bourne shell

Steffen Nurpmeso steffen at sdaoden.eu
Wed Jan 4 06:19:00 AEST 2023


Steve Nickolas wrote in
 <alpine.DEB.2.21.2301031307001.9988 at sd-119843.dedibox.fr>:
 |On Tue, 3 Jan 2023, Dan Cross wrote:
 |> Something I've noticed is that lots of people try to increase
 |> complexity to solve problems, and it rarely occurs to them to
 |> eliminate complexity to solve problems. Sometimes the reasons for this
 |> are good; most of the time they are not.
 |>
 |>        - Dan C.
 |
 |I think of the saying: "Perfection is not when there is nothing left to 
 |add, but when there is nothing left to remove."

He (Exupéry) was then shot down.

I always seem to response this to that.
Hmm, openpgp at ietf.org (to which i have almost zero to add
technically shall someone think that, nor do i want) lastly

   |"Perfection is achieved not when there is nothing more to add but when \
   |there
   |is nothing left to take away" - Antoine de Saint-Exupéry.

  He was then shot down.

But yes, he then really went missing.

The topic ..
I do not miss times where suddenly a shell script breaks because
": > FILE" does not work (just recently 'realized from reading code
of Paul Eggert of GNU/IANA TZ, "hey, > FILE" is of course
sufficient!"), i fixed it via "printf '' > FILE" by then; whatever
the reason.  May it be bugs or (local) miscompilations, not
detected due to missing unit tests and a too small user base.

Portable?  If i find /usr/xpg4/bin i quickly add it to $PATH for
the much better awk (but beware of documented double expansion
issues) and the much much better sh(1).
Some things just require that, noclobber I/O redirection (set -C)
for example.  (mktemp(1) is still not part of the POSIX standard.)

Besides i miss(ed) the history; the author of bmake (and
verieexec) just last year asked me why i would use stty for
a purpose ("(<&1 >/dev/null stty -a) 2>/dev/null") instead of
simply using "[ -t 1 ]", and indeed, i found that as soon as BSD
4.1 and Research V7, but it surprised me.
Without an oversight of the history and the lack of many systems
to test, perl(1) was omnipresent and if only for OpenSSL and so
using it for almost anything seemed save.

  To love is not to look at one another: it is to look,
  together, in the same direction.  Antoine de Saint-Exupéry.

A happy and healthy new Year 2023 is now overdue.
Even Giants have to die, but with holding hands it can wait a bit
longer, i hope.
I wish that from Germany to all of you, and deliberately beyond
NATO readership.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the TUHS mailing list