4 ms·
There's some debate about this if I recall correctly from the last deep dive I did about the pros and cons of it. If I am writing a script that needs to be tha
by kyuudou 7y ago
There's some debate about this if I recall correctly from the last deep dive I did about the pros and cons of it.
If I am writing a script that needs to be that portable, then I'll use #!/usr/bin/env sh but otherwise /bin/sh will work in all the cases I need it to.
Since bash's path might vary more, I might consider calling env to locate it then more often.
- naniwaduni 7y agoIf you're writing a script that needs to be that portable, you're doomed anyway and you might even find the autoconf manual's "Limitations of Shell Builtins" section useful.
- oat_bravo_nap 7y agoIf you are using /bin/sh you need to check sure it is a POSIX shell script and not using bash features [1]. On Debian and derivatives /bin/sh is ash not bash. [1] https://linux.die.net/man/1/checkbashisms https://linux.die.net/man/1/checkbashisms