POSIX states that executing a file with “#!” as its first two bytes results in implementation-defined behavior, but I don’t think there’s any OS out there that doesn’t do the right thing (maybe the POSIX layer on z/OS or somrthing, I wouldn’t know).
More usefully, POSIX does require that any file executed that isn’t a loadable executable and doesn’t start with shebang is passed to /bin/sh, meaning shell scripts don’t technically need shebangs.
POSIX states that executing a file with “#!” as its first two bytes results in implementation-defined behavior, but I don’t think there’s any OS out there that doesn’t do the right thing (maybe the POSIX layer on z/OS or somrthing, I wouldn’t know).
More usefully, POSIX does require that any file executed that isn’t a loadable executable and doesn’t start with shebang is passed to /bin/sh, meaning shell scripts don’t technically need shebangs.