shebang

The first line of a script, starting with #!, that names the program the operating system should use to run it.

In more detail

For example #!/usr/bin/env bash asks for bash and #!/usr/bin/env python3 asks for Python, found wherever the shell would find them. The line only matters when the file is run directly as a program, which also needs the executable permission bit.

Example

An Ansible inventory script needs both a shebang and the executable bit, because Ansible runs it rather than reading it.

Related terms

Taught in

References