I’ve recently began playing with some legacy Bourne Shell commands, namely the GitHub repo heirloom-sh. I have it installed at /usr/local/bin/sh and nothing links to it. Still, some scripts call it somehow.
I posted an expanded question on the Unix & Linux SE site also.
Background
For most systems, /bin/sh is a link to /bin/bash, letting everything for BASH work in a mis-labaled Bourne Shell script.
For Debian, /bin/sh is a link to /bin/dash (Debian Shell), carrying many Bourne Shell limits. So, Debian/Ubuntu devs might not run into the same problems of BASH scripts still working with #!/bin/sh. This may mostly be a non-Debian dev issue.
Most of our scripts are written for BASH (/bin/bash) and cannot work for Bourne Shell (/bin/sh). But, many coders still put #!/bin/sh for the shebang (#!/...) anyway, then code as if for the BASH #!/bin/bash.
Affecting VSCodium
One of these I’ve found is the vscodium AUR package, and vscodium-bin (which I use). As long as I have the legacy shell installed at /usr/local/bin/sh, some things break.
/opt/vscodium-bin/bin/codium (Where VSCodium is installed to from the AUR)…
had this:
#!/usr/bin/env sh
…which would not start from the GUI, and then from the CLI threw this error:
/opt/vscodium-bin/bin/codium: syntax error at line 20: `YN=$' unexpected
So, I commented and changed the shebang to this:
#!/usr/bin/bash
…then it worked.
Affecting Manjaro specifically
In fact, when I had /bin/sh linked to /usr/local/bin/sh (the legacy Bourne Shell), my Manjaro system wouldn’t even boot. I had to use a Manjaro install USB to get to the OS disk and change /bin/sh to link back to /bin/bash.
That may be an issue that Manjaro devs should know about.
Perhaps any script at all that uses #!/bin/sh or #!/bin/env sh should be fixed in Manjaro, and upstream sources get a bug report.
I’m posting this on Manjaro because, while an Arch problem, then want me using Arch or I get ignored. But, this is a wider developer issue.