News for hackers. Stuff that matters.
Re:Minimal safe Bash script template by patrec on Tuesday December 15, 2020 @10:03AM (#25430904)
It would be nice if bash were not a moving target. I have run into several bash incompatibilities in real life. Bash on macOS differs substantially from bash on Linux because it's much older. But bash is also generally somewhat poorly designed, leading to lots of aggravating and puzzling behavior for "corner cases" and this behavior not infrequently changes between versions.

So for example set -u for the longest time used to trigger on defined but empty arrays (which is hardly an obscure edge case), but what workarounds are possible differs quite a bit between versions:

https://gist.github.com/dimo414/2fb052d230654cc0c25e9e41a965...

Re:Minimal safe Bash script template by thomasbacklund on Tuesday December 15, 2020 @10:14AM (#25431012)
Yeah, I agree..

I was listening to the Command Line Heroes podcast the other day, about Bash. First version was stored on tape. So it has some legacy, hehe. Already then the requirement was to be backwards compatible with sh, so yeah, corner cases are around for sure.

If writing bash I do aim at version 3, because as you say they got that on MacAttack.