Hacker News new | ask | show | jobs
by ndsipa_pomu 11 days ago
Yes, Bash is filled with footguns and is awful due to that. However, it's still incredibly useful as it's everywhere and has a far greater lifespan than almost anything else. You can write scripts in PowerShell or nushell, but then find that twenty years later they're no longer usable or you find a twenty year old machine that won't have PowerShell/nushell installed.

It's not so much about defending arcane scripting skills, but that Bash functions as a lowest common denominator and is useful because of that. If you want something that works reliably over decades, then it's best not to go for an "improved" shell as it may not still be around.

I like to think of Bash script writing as the opposite of riding a bike - you have to relearn it almost every time you write a script.

1 comments

You won't find bash on BSD unless someone installed it.
Possibly why cloud servers are 85% Linux, 14% Windows and 1% Other (including BSD).

My main shell isn't even bash, I go with zsh, but if I'm writing a script for general use I go with bash.

I haven't had to admin any BSD systems, so am happy with choosing Bash. Presumably posix-compliant scripts would be used to also cope with BSD systems.