Native shebang: Difference between revisions
Content added Content deleted
Langurmonkey (talk | contribs) |
|||
Line 597: | Line 597: | ||
Hello, world! |
Hello, world! |
||
</pre> |
</pre> |
||
=={{header|Phix}}== |
|||
Phix is a hybrid interpreter/compiler, so a shebang adds little value anyway, however should the first |
|||
line of the main file start with #! it is ignored/skipped. The only difference between interpretation |
|||
and compilation, apart from the executable file, is a -c flag on the command line, which I recommend |
|||
omitting unless it proves helpful or necessary. Example: |
|||
<lang Phix>#!/path/to/phix</lang> |
|||
You can also invoke the compiler directly as follows |
|||
<lang Phix>string sourcefile = "test.exw", |
|||
interpreter = get_interpreter(true), |
|||
cmd = sprintf("%s %s",{interpreter,sourcefile}) |
|||
integer res = system_exec(cmd)</lang> |
|||
See also demo/capture_console.exw which redirects stdin/out/err while interpreting a child process. |
|||
=={{header|Python}}== |
=={{header|Python}}== |