23 ms·
To be honest, this is a self-solving problem. * People who use the shell often enough to be bitten by having an old version of bash know how to update it * Pe
by leokennis 6y ago
To be honest, this is a self-solving problem.
* 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
- arendtio 6y agoWell, not entirely. The problem I have is that this old version has serious bugs. 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.
- SAI_Peregrinus 6y agoIt doesn't run on Windows either. Or Alpine Linux. Or most of the BSDs.
- arendtio 6y agoAFAIK Windows doesn't come with any bash out of the box, do you mean, that the WSL bash is an old one too? What is wrong with Alpine and the BSDs? Do they also use old bash versions?
- SAI_Peregrinus 6y agoNo, they just don't have Bash out of the box. Bash isn't universal. Nothing really is, but Bash definitely isn't. Expecting Bash to work on MacOS without checking seems weird to me, since most it doesn't work on most OSes by default.
- arendtio 6y agoNot having bash installed by default is not the issue here. The issue is that macOS comes with a buggy version of bash and those bugs cause valid scripts to fail in a unique way. So at first you might think everything is just fine (because there is a bash) and but in fact you either have to test against those bugs or install a newer version.