Hacker News new | ask | show | jobs
by yjftsjthsd-h 1109 days ago
Shell is a bad fit for many uses (an ACME client is more ambitious than I would build in shell, personally), but the things it's good at, it's really good at. I have yet to find anything else that's even close to as good for glue code when I have a handful of tools and/or a bunch of files that I need to string together. Unless you're writing in Ada, I promise whatever language you think is better has its own sharp edges (if we're allowing eval, then not many languages are going to be safe, really).
2 comments

I usually replace shell scripts with python (using sh module: https://amoffat.github.io/sh/ for calling other scripts/programs).
Golang is better suited for this, for my needs at least.
Yeah, lego-acme is a solid alternative.

https://github.com/go-acme/lego

Er, are we comparing ACME clients or shell alternatives?
yeah until your scripts stop running someday because python...
Can you elaborate?
Python scripts will often break with system upgrades, most acutely when Python2 went away, but under many other circumstances as well.
I would expect python2 to only have gone away across major versions of an OS, which is about as non-disruptive as it could have been, considering.

Of course, as I write this ansible is broken on one of my machines for reasons that appear to stem from a python 3.x->3.y update, so...

That's the thing — Python can break with any OS update (I personally can break it whenever I touch it ;)

OTOH a script for /bin/sh written 30 years ago has a good chance running today unchanged.

Having said that, I still would not recommend shell for anything that needs to be robust and secure.

macOS doesn’t even come with Python..
Ever tried TCL? Curious on your thoughts.