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.
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...