Postsread more
The Disappearing Script: Shebang Tricks and Magic Numbers
Open any script and the first line is probably #!/usr/bin/env bash. You’ve typed it so many times it’s muscle memory. The cursor lands, you type the shebang, and you move on.
But here’s a question worth pausing on: who actually reads that line?
Not the shell. Not Bash. The kernel.
The Magic Bytes
Ok, ok… that’s not completely true. If you run a script specifying the shell you want to use, as in: