#! | |
---|---|
shebang |
In computing, a shebang is the character sequence #!, consisting of the characters number sign (also known as sharp or hash) and exclamation mark (also known as bang), at the beginning of a script. It is also called sharp-exclamation, sha-bang,[1][2] hashbang,[3][4] pound-bang,[5][6] or hash-pling.[7]
When a text file with a shebang is used as if it were an executable in a Unix-like operating system, the program loader mechanism parses the rest of the file's initial line as an interpreter directive. The loader executes the specified interpreter program, passing to it as an argument the path that was initially used when attempting to run the script, so that the program may use the file as input data.[8] For example, if a script is named with the path path/to/script, and it starts with the line #!/bin/sh
, then the program loader is instructed to run the program /bin/sh, passing path/to/script as the first argument.
The shebang line is usually ignored by the interpreter, because the "#" character is a comment marker in many scripting languages; some language interpreters that do not use the hash mark to begin comments still may ignore the shebang line in recognition of its purpose.[9]
{{cite book}}
: CS1 maint: multiple names: authors list (link)