- Article pages now have a discussion option at the bottom (moderated/captcha, but no registration needed)

Interpreter Directive

  • shebang

The interpreter directive, usually called shebang, is the character sequence starting with #! (hash, expclamation-point) at the beginning of the very first line of an executable text file on unixoid operating systems.

The program loader of the operating system may use this line to load an interpreter for this file when executed. This makes it a self-executable script.

A shebang will typically look like

#!/bin/bash

Since the line starting with # is a comment for the shell (and some other scripting languages), it's ignored.

Regarding the shebang, there are various, differences between operating systems, including:

  • may require a space after #! and before the pathname of the interpreter
  • may be able to take arguments for the interpreter

POSIX® doesn't specify the shebang, though in general it's commonly supported by operating systems.

See also

  • #!-magic - a nice overview of the differences between various operating systems

Discussion

Enter your comment
 
dict/terms/interpreter_directive.txt · Last modified: 2011/01/11 07:25 by thebonsai
GNU Free Documentation License 1.3
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0