Comment by _bernd
2 days ago
> Bash scripts requires "set -eu" at minimum, when written by LLM or human.
No. It does not. Just write good scripts and catch errors and handle them. That's the same more less with every language. And bash can be written in a way that it is sane and readable and maintainable. Just because you have seen a lot of junk in the language does not make the language bad per se. Sure there are a lot of languages "features" which are more then questionable but I want to rise again the point that it has its place and can be used in a good way.
I agree completely, if you use a linter like shellcheck [1]. If you're just winging it, then no.
I first learned about shellcehck when I worked with someone that claimed they could write flawless bash scripts, then blamed me when their script broke because there was a space in a folder name. I ran his scripts through, resulting in him immediately adopting it, while he enjoyed eating crow.
[1] https://www.shellcheck.net
Yes :) I'm using shellcheck since at least 2012/2014. And I loved the bash haters handbook <3 in all seriousness, bash will shine then when you have no heavy tooling available and we still have these systems around as at least at some point in time in their life time. With most stuff in life: you should take care and pay attention
Then, I think we fully align. Yes, shell scripts aren't going anywhere, and are pretty great. I usually write several per week. I just make sure to enable eu, and also have error traps, with little error messages, because I hate heisencode more than anything.
But, you'll never convince me that "ignore errors by default" is sane. ;)
Ah yes, the Feynman Algorithm for shell scripting.