> Yep, imagine how things would be like if the kernel didn't understand shebangs. exec() calls would fail for non-ELF executables and we'd be devising all sorts of ridiculous workarounds. We're lucky that didn't happen.
Actually, that did happen. Quoting https://utcc.utoronto.ca/~cks/space/blog/unix/ExecAndShebang...
"In V7 (and versions before it), the exec*() family of system calls only worked on actual binary executables. In order to make shell scripts more or less work, the shell (and I think perhaps some other programs) reacted to an ENOEXEC error by assuming the executable was actually a shell script."
And yes, the ridiculous workaround (treating the file as a shell script when it's not an executable) seems to still exist to this day.