
Hash Bang Null Hack: pass 2+ args when 1 allowed - kazinator
http://nongnu.org/txr/txr-manpage.html#N-01DF6FA2
======
kazinator
Synopsis of the idea:

    
    
       #!/path/to/interpreter one-allowed-arg<NUL>trailing material<LF>
    

The kernel is written in C, and so its hash bang mechanism only sees
"#!/path/to/interpreter one-allowed-arg".

The interpreter executes with that argument, and then opens the script, looks
for the NUL character in the first line and retrieves and parses the
additional arguments { "trailing", "material" }, combining them into { "one-
allowed-arg", "trailing", "material" }.

Advantage: this can be retrofitted into just about any interpreter without
disturbing the language. Alternatives like encoding the extra args on the
following line are more disruptive.

Tested on Linux, MacOS, Solaris and Cygwin.

