WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: "For your sanity, please use something like Tcl or a Scheme."  (Read 289 times)

Offline mocore

  • Hero Member
  • *****
  • Posts: 749
  • ~.~


https://git.sr.ht/~q3cpma/scripts/


Quote
See this portability matrix for details:
   POSIX 2024    GNU    busybox    toybox    MacOS    FreeBSD    OpenBSD    NetBSD    Illumos    Solaris 10    Solaris 11    AIX
realpath    Y    Y    Y    Y    Y*    Y    Y    Y    N    N    Y    N
xargs -0    Y    Y    Y    Y    Y    Y    Y    Y    Y    N    Y    N
sed -E    Y    Y    Y    Y    Y    Y    Y    Y    Y    N    N    N

So unless specified otherwise in individual scripts, this collection should work out-of-the-box on Linux, all BSDs and modern MacOS (*: at least Ventura/13 for realpath).

As an addendum, the lesson to be taken from all of this is that POSIX sh scripting is powerful but insanely brain damaged if you want to stay portable, and just a bit less obscene if you choose to tie yourself to a more "complete" implementation like ksh/zsh/bash (want set -o nullglob?) and a specific platform (to get util-linux or BSD base).

For your sanity, please use something like Tcl or a Scheme.

now they tell me ! 
:p



Offline mocore

  • Hero Member
  • *****
  • Posts: 749
  • ~.~
Re: "For your sanity, please use something like Tcl or a Scheme."
« Reply #1 on: April 09, 2026, 04:43:57 AM »

>also a few bash scripts when arrays are really needed

makes me wander ,
(why?) would awk not suffice ?