Why does the "she-bang" begin with a #!, like #!/bin/bash? I have always accepted that this how it is done, but is there a reason behind it?
Why start with #; isn't that usually a comment? Or is it the point that it should be comment?
|
Typically shebang refers to just the It does intentionally start with a comment character for backwards-compatibility with things that don't know how to handle it; the |
|||
|
|
It needs to be a comment because only this way it will also work to run a script like "interpretername scriptname". I do not know about the origin of the "!". |
|||||||
|
#!(as much as dmr remembers…), including an explanation of why the#(yes, the line had to be ignored by existing shells). – Gilles Jul 13 '11 at 13:08