> I see this sentiment a lot, but it’s not a useful one...
Consider this response for entertainment purposes only. It’s easy to become insult(ed|ing) or get into a holy war, but I’m really not invested in any of that.
That said: it is a useful sentiment, and a kubernetes script written in sh(1) is not the answer to the question.
That one “can” does not mean one “should”.
The reddit comment cites init scripts (I happen to use RC scripts, and haven’t viewed init scripts in a while) as an example of why shell is so great - everybody uses init!
1) of course everybody does. And it -happens- to be written in shell. So what?
2) this is fine! The scripts I see are 10s of lines long and practically flow top->bottom w maybe one or two conditionals.
This is more akin to a job control language. A perfect application for sh(1).
I just feel it (and you can too): sh(1) (or bash - nobody cares) features feel archaic and brittle. People have written impressive work in brainfuck[0][1], or C that just emits mov[2] instructions; is that a case for brainfuck projects or mov-only assembly? No. It’s just interesting. And kubernetes scaffolding or anything else big that happens (by some miracle) to work are not excuses for huge shell scripts. That’s just tautology - otherwise we’d be talking about the virtue of these scripts. For a boot sequence (rc/init) even if we ignore that the short scripts are actually suitable for the important job, I’d say their other grace is that sh(1) is demanded by POSIX, so you don’t need to wonder if it’s available in this nascent state of booting your OS - you’re guaranteed. The same couldn’t be said for ruby or python.
From the “see this comment” comment:
> Have you ever written a bash completion script yourself? I did a few years ago and I am scared to ever touch it again! I have a non-deterministic bug that I can't figure out, so I just restart my terminal every time completion gets borked. And I know bash very well.
The comment admits what a warzone the space is... Sure, fix it, but we don’t need to promote it.
The sentiment of discouraging huge shell scripts the GP expressed is useful. Resist.
[0] https://en.wikipedia.org/wiki/Brainfuck
[1] https://rosettacode.org/wiki/Category:Brainf***
[2] https://youtu.be/R7EEoWg6Ekk