Bash vs sh Shebangs
Discussions center on the use of #!/bin/bash versus #!/bin/sh in shell script shebangs, debating portability, POSIX compliance, bashisms, and system differences like dash or env usage.
Activity Over Time
Top Contributors
Keywords
Sample Comments
I said /bin/sh, not /bin/bash.
Not all systems have bash as /bin/bash. A shebang line of '#!/usr/bin/env bash' would be even more portable.
It was with bash, not sh. Hm interesting.
Not for shellcheck(1). It warns about bashisms if it sees `/bin/sh` after the hash-bang.
have you pointed /bin/sh and /bin/bash at it?
Why make it bash specific instead of sh?
That's a bashism I think and hence not as portable as POSIX shells.
Most of the time /bin/sh would suffice as no bash features are used but people still use /bin/bash.
Pray for all those scripts out there that assume /bin/sh or /bin/bash exists. Sounds like they only have a couple more years of error-free life
It's not shell scripts, it's /bin/bash -- the guy fieri of shells.