What is the shebang?
The shebang is a special character sequence in a script file that specifies which program should be called to run the script. The shebang is always on the first line of the file, and is composed of the characters #! followed by the path to the interpreter program. You can also specify command line options, if necessary. For example, the following line contains the shebang, the path to the Perl interpreter, and the command line option -w:Many scripting languages, such as Perl, use the # character to indicate the beginning of a comment line that should be ignored by the interpreter. The shebang is a special exception to this rule.
Using the correct shebang
The following table shows the correct shebangs to use in script files that run on hosting.com web servers:| Language | Shebang |
|---|---|
| Perl | #!/usr/bin/perl |
| Python (generic) | #!/usr/bin/python |
| Python (specific version) | #!/usr/bin/python2.7 #!/usr/bin/python3.6 … etc. |
| Ruby | #!/usr/bin/ruby |
| PHP | #!/usr/local/bin/php |
You do not need to use the shebang for PHP script files that generate web output.