Multiline shebang: Difference between revisions
m
→{{header|Wren}}: Minor tidy
m (→{{header|Wren}}: Minor tidy) |
|||
Line 749:
You can get around this by placing shell commands in a block comment after a single line shebang. So (ignoring the strange error message) the following works:
<syntaxhighlight lang="
/*
echo "Hello from bash"
/bin/wren
exit
*/
Line 759:
{{out}}
<pre>
$ chmod +x
$ ./
./
Hello from bash
Hello from Wren
Line 767:
<br>
However, we don't actually need a multiline shebang to get the script name as this is always passed automatically as the second command line argument when the Wren process is spawned, the first argument being the Wren executable itself. Moreover, if a single line shebang is used, the third argument will be the shell command used to execute the script.
<syntaxhighlight lang="
import "os" for Process
Line 780:
{{out}}
<pre>
$ chmod +x Multiline_shebang_2.wren
$ ./
Executable : /bin/wren
Script name :
Shell command : ./
Argument 1 : one
Argument 2 : two
|