$ /bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc. $ /bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.* People who use the shell often enough to be bitten by having an old version of bash know how to update it
* People who use the shell infrequently enough not to be bitten by having an old version of bash don't care
So you write a bash script, test it with a modern bash and everything looks fine. But then you start the same script on a fresh macOS and it doesn't run. Took me a while to figure out it wasn't because of my script but because of the outdated bash version on macOS.
And I am not talking about 'don't use that option' kind of bugs but more along the lines of 'when you nest too many sub-shells it doesn't find its way back and throws a syntax error'. So if you want to make sure your scripts work out of the box on macOS you have to test against that old buggy shell.
What is wrong with Alpine and the BSDs? Do they also use old bash versions?
Imagine my surprise -- because I didn't fully consider these actions -- when my terminal session started ignoring my commands partway through that process. It turns out that it is a Bad Idea to delete your shell binary when you're using it.
Fortunately, VS Code's terminal uses a different shell binary so I was able to complete the upgrade there.
Another day, another reminder to Be More Careful.