I have a shell script intended to run as bash
, on all of MacOS, Windows and Linux (Ubuntu).
The problem is that the shebang is not compatible between MacOS and the others, as MacOS expects /bin/bash
while Windows and Linux expect /usr/bin/bash
.
/usr/bin/bash
is not available on MacOS, and sudo ln -s /bin/bash /usr/bin/bash
fails as well (I guess, OS protected write?).
How do I write a bash shebang that works correctly on all OSs?