Multiline shebang: Difference between revisions
Content added Content deleted
(add E) |
(Remove all missing-the-point "just use a plain shebang" examples; there's not enough to them to be worth keeping until fixed.) |
||
Line 34: | Line 34: | ||
=={{header|Emacs Lisp}}== |
=={{header|Emacs Lisp}}== |
||
<lang lisp>:;exec emacs -batch -l $0 -f main $*</lang> |
<lang lisp>:;exec emacs -batch -l $0 -f main $*</lang> |
||
=={{header|Erlang}}== |
|||
{{incorrect|Erlang|This is not a multiline shebang. A plain #! can only have one line.}} |
|||
Note that the binary is escript, not erl. The latter refuses to compile or run code that contains a shebang. |
|||
<lang erlang>#!/usr/bin/env escript</lang> |
|||
=={{header|Haskell}}== |
|||
{{incorrect|Haskell|This is not a multiline shebang. A plain #! can only have one line.}} |
|||
A plain shebang will do. |
|||
<lang haskell>#!/usr/bin/env runhaskell</lang> |
|||
=={{header|JavaScript}}== |
|||
{{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}}== |
|||
{{incorrect|Lua|This is not a multiline shebang. A plain #! can only have one line.}} |
|||
A plain shebang will do. |
|||
<lang lua>#!/usr/bin/env lua</lang> |
|||
=={{header|newLISP}}== |
|||
{{incorrect|newLISP|This is not a multiline shebang. A plain #! can only have one line.}} |
|||
A plain shebang will do. |
|||
<lang lisp>#!/usr/bin/env newlisp</lang> |
|||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
Line 72: | Line 41: | ||
& eval 'exec /usr/bin/perl -wS $0 $argv:q' |
& eval 'exec /usr/bin/perl -wS $0 $argv:q' |
||
if $running_under_some_shell;</lang> |
if $running_under_some_shell;</lang> |
||
=={{header|Python}}== |
|||
{{incorrect|Python|This is not a multiline shebang. A plain #! can only have one line.}} |
|||
A plain shebang will do. |
|||
<lang python>#!/usr/bin/env python</lang> |
|||
=={{header|R}}== |
|||
{{incorrect|R|This is not a multiline shebang. A plain #! can only have one line.}} |
|||
Note that the binary is Rscript, not the R interpreter. Regardless, scripts must end with q("no") in order to terminate and return to the shell. |
|||
<lang R>#!/usr/bin/env Rscript</lang> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |