> Bash augmentations lessen some of the pains, and it's just nicer
Both sh and bash are terrible, ugly hacks. Anything that requires more than 3 lines of them (including the #! line) should be written in a proper scripting language.
Though I do agree that cross-platformity to that level is rarely meaningful, and so things like python are just as likely available/can be made available.
My system Python tree is almost 1GB. That doesn't matter for desktop systems, but most software is published as container images these days and using a language like Python, Ruby or Perl for an image that doesn't already need it is pretty wasteful and pulls in a lot of extra dependencies.
I'm not sure there is a good alternative to sh/bash shell scripts as most dynamic languages have become pretty large dependencies these days.
That surely includes plenty of globally installed dependencies. I looked at the package sizes for debian and it is around 100 kB for the python3 package and on the order of another 100kb for python3-minimal. Couldn’t find a cumulative install size, but it is surely not larger than a few megabytes.
Until someone decides to write something that's only available in X version of Python. While there are certainly v4 and v5 bash-isms, they are far and few between compared to most languages.
...that said, having to support bash 3.2 for MacOS is a horrible thing.
AWK is part of the POSIX standard and is therefore on every UNIX-like. People really need to remember AWK exists and is a real, proper scripting language with a very sane syntax (it's not just for cryptic one-liners, really!)
Add a flake.nix file and you get completely reproducible program versions if you really want.
But I know that you meant it as a rhetoric, so my non-rhetorical answer would be that python3 is almost universally available on distros that are not minified deliberately (containers).
> python3 is almost universally available on distros that are not minified deliberately (containers)
Writing control scripts for use inside containers is currently my biggest application of BASH scripts. What makes BASH (or other shells) handy is the lack of supporting files that are needed - just copy in the script and you're ready to go.
I was going to say something similar. I try to avoid adding anything to my final images. Each extra dependency is something else to update, more surface areas for attacks, another thing to justify, etc. Much rather just use the slimmest base and the tools already available.
The various sub-versions of bash are a lot more compatible than the sub-versions of python 3. Just today stuff was breaking on me because of differences between python 3.6 and 3.8
It depends on what features of BASH that you want to use. If you target v3 (as I usually do), then that or a newer version will likely be already installed. There's very little issue with backwards compatibility.
Both sh and bash are terrible, ugly hacks. Anything that requires more than 3 lines of them (including the #! line) should be written in a proper scripting language.
Though I do agree that cross-platformity to that level is rarely meaningful, and so things like python are just as likely available/can be made available.