Shebang

Shebang

The #! syntax is used in scripts to indicate an interpreter for execution under UNIX / Linux operating systems. The directive must be the first line in the Linux shell script and must start with shebang #!. You can add argument after the shebang characters, which is optional. Make sure the interpreter is the full path to a binary file. For example: /bin/bash.

Syntax

The syntax is:

#!/path/to/interpreter [arguments]
#!/path/to/interpreter -arg1 -arg2

Examples

Most Linux shell and perl / python script starts with the following line. Bash or sh example:

#!/bin/bash