In computing, a shebang (also called a hashbang, hashpling, or pound bang) refers to a pair of characters "#!" that, when used as the first two characters on the first line of a script, causes Unix-like operating systems to execute that script using the interpreter specified by the rest of that line.
More precisely, a shebang line consists of a number sign and an exclamation point character ("#!"), followed by the (full) path to the interpreter program that will provide the interpretation. The shebang is looked for and used when a script is invoked directly (as you would a regular executable), and largely to the end of making scripts look and act similarly to regular executables, to the operating system and to the user.
The name shebang comes from an inexact contraction of SHArp bang or haSH bang, referring to the two typical Unix names of the two characters. Unix jargon uses sharp or hash to refer to the number sign character and bang to refer to the exclamation point, hence shebang. Another theory on sh in shebang's name is from default shell sh
, usually invoked with shebang.
Because the "#" character is often used as the comment marker in scripting languages, the contents of the shebang line will be automatically ignored by the interpreter itself; the shebang line only exists to specify the correct interpreter to be used.