Jump to content

Native shebang: Difference between revisions

Added Wren
(Added Wren)
Line 872:
<pre>
Hello, world!
</pre>
 
=={{header|Wren}}==
Normally, Process.arguments[0] would return the (first) command line argument but here we need to use Process.arguments[1] because the first argument passed to Wren's command line interpreter is ''./native_shebang.wren''.
<lang ecmascript>#!/bin/wren native_shebang.wren
import "os" for Process
System.print(Process.arguments[1])</lang>
 
{{out}}
<pre>
$ chmod +x native_shebang.wren
$ ./native_shebang.wren "Hello world!"
Hello world!
</pre>
 
9,485

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.