Don't use Bash case fallthrough
The feature was added in Bash 4.0, however, according to @markaltmann, some Mac systems still use Bash 3.x
The feature was used only for expressiveness, the line using it is completely optional (since the case it falls through to is *, aka a catch all), thus it can be safely removed without changing the logic.
More on that, all macos systems use this old bundled Bash from 2007.
Reason is apparently licensing issues with the DRM in Apples app store.
Version 3.2.57 was the last under GPL-2.
I have also now opted to another bash package and not use the bundled one, then you are with 5.2.
IMHO a shitty decision by Apple. The same is true for many bundled software like python or ruby.
@markaltmann Holy ****!
Would it be better to shift to just supporting sh, which AFAIK every OS but iOS and Windows has 😛 ?
Thanks for the all the work, I'm still catching up after KubeCon and now enjoying Thanksgiving in the US, so I hope to get to the PR reviewing in the next few weeks 🤜🤛
Would it be better to shift to just supporting sh, which AFAIK every OS but iOS and Windows has 😛 ?
Honestly, that has a few of it's own set of gachas:
- According to this Ubuntu wiki page,
$LINENOis not supported indash, the defaultshin Ubuntu. Though, the page is from 2017, so I don't know how accurate the statement is today, however, it remains that on older Ubuntu systems it might not work. - The
pipefailoption inset -Eeo pipefailis Bashism, so that would have to go, potentially having unforeseen consequences? EDIT: As of POSIX 2024 pipefail is part of POSIX, though considering we are still discussing whether Bash 4.x is supported widely enough, I don't know when that will become universal.
The case fallthrough is Bashism (>v4.0) so it will have to be removed if we switch to POSIX anyways.
From the top of my head, everything else seems to be POSIX compliant, so it might not be a bad choice.