From Modula-2 Reloaded

WiP: Hashbang

Objective

The objective of this feature is to allow Modula-2 program sources to conform to the Hashbang or Shebang convention on Unix operating systems.

Hashbang convention

On Unix like operating systems, the program loader considers any text file whose first two characters are #! (called Hashbang or Shebang) to be an executable script. The program loader interprets the character sequence following the hashbang as a pathname to the interpreter that can interpret and execute the script. It will then try to invoke the interpreter specified in the path and pass the script as an argument.

Lexer Requirement

Any Modula-2 lexer shall examine the first two characters of the first line of a Modula-2 program source file and if they are # and ! respectively then it shall ignore the first line of the file entirely and begin lexing the file in the second line instead.

Retrieved from http://modula-2.net/m2r10/pmwiki.php?n=WiP.Hashbang
Page last modified on 2010-04-14 14:42