by latexr · 3y ago · 0 comments
Meaning /bin/sh is not more portable because you can’t be sure which shell will be used.
Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH, ensuring that the returned pathname is an absolute pathname and not a shell built-in.
I don't know how this trend started but now it's been cargo-culted to death. Same with the /usr/bin/env thing in shebangs. shellcheck --shell sh myscript.sh