This is hilarious. A #Google engineer invented #zx to make command line scripting easier with #NodeJS, because at a certain point #shell scripts get too complicated and you need a Real #Programming Language.

https://github.com/google/zx/

This is exactly #Perl’s use case from thirty-six years ago. But the kids want #JavaScript everywhere and would rather it take more work to convert their ascended #Bash scripts to a vastly different syntax.

https://github.com/google/zx/issues/581#issuecomment-1516573139

#Unix #Linux #ProgrammingLanguages

GitHub - google/zx: A tool for writing better scripts

A tool for writing better scripts. Contribute to google/zx development by creating an account on GitHub.

GitHub
@mjgardner In my Unix sysadmin handbook from about 15yrs ago, they make a big point about shell scripts beyond 50 lines really need to become Perl or Python. I am by no means a programmer but I tend to use that as a yardstick. I've seen a *tonne* of horrendous shell scripts that could use the lesson though.
@sullybiker @mjgardner dehydrated, possibly the most easy to use ACME/LetsEncrypt client is written in bash (2260 lines).
testssl, probably the easiest to use SSL/TLS tester is also written in bash (24041 lines).
Just sayin'. 😁

@grin @sullybiker The main problem with #shell scripts is that they’re glue for other commands that may or may not be installed and may or may not be the same as those used by the author.

It’s why #dehydrated has so much logic detecting the installed flavor of awk, sed, grep, diff, et al. “Portable” shell is like portable #C—riddled with brittle environmental tests (thus begetting things like #GNU #Autotools).

Even #testssl admitted defeat and can run from a #Docker #container now.

@mjgardner @grin Even steam has a pretty beefy shell script launching it, I've had to poke around in it back in the early days and it always gave me a headache.
@sullybiker @mjgardner I always thought steam (linux) is held together by duct tape.
I occasionally wonder the effect of the large amounts of errors it keeps throwing. bash aside.
@grin @mjgardner Yes it is a bit of a porridge