Anonymous user
Multiline shebang: Difference between revisions
m
Distinguish languages from implementations
(→{{header|Tcl}}: Fixed) |
m (Distinguish languages from implementations) |
||
Line 5:
The syntax for a multiline shebang is complicated. The shebang lines must be simultaneously commented away from the main language and revealed to Bash so that they can be executed.
=={{header|Chicken Scheme}}==▼
#| ... |# provides just the right environment for the multiline shebang. Here, the script name is passed once to the Chicken Scheme Interpreter and once to be picked up in args.▼
<lang scheme>#!/bin/bash▼
#|▼
exec csi -ss $0 ${1+"$@"}▼
exit▼
|#</lang>▼
=={{header|Clojure}}==
Line 44 ⟶ 35:
<lang haskell>#!/usr/bin/env runhaskell</lang>
{{works with|Node.js}}
{{incorrect|Node.js|This is not a multiline shebang. A plain #! can only have one line.}}▼
A plain shebang will do.▼
<lang javascript>#!/usr/bin/env node</lang>▼
=={{header|Lua}}==
Line 56 ⟶ 54:
<lang lisp>#!/usr/bin/env newlisp</lang>
▲=={{header|Node.js}}==
▲{{incorrect|Node.js|This is not a multiline shebang. A plain #! can only have one line.}}
▲A plain shebang will do.
▲<lang javascript>#!/usr/bin/env node</lang>
=={{header|Perl}}==
Line 87 ⟶ 79:
<lang ruby>#!/usr/bin/env ruby</lang>
{{works with|Chicken Scheme}}
▲<code>#| ... |#</code> provides just the right environment for the multiline shebang. Here, the script name is passed once to the Chicken Scheme Interpreter and once to be picked up in args.
▲<lang scheme>#!/bin/bash
▲#|
▲exec csi -ss $0 ${1+"$@"}
▲exit
▲|#</lang>
=={{header|Smalltalk}}==
|