mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-11 05:59:52 +00:00
8181792: nashorn samples/exec.js has some incorrect examples
Reviewed-by: sundar, hannesw
This commit is contained in:
parent
6c1410fffa
commit
de9651c66a
@ -38,11 +38,8 @@ $EXEC("ls -la")
|
||||
// It can also be given a string to use as stdin:
|
||||
$EXEC("cat", "Hello, world!")
|
||||
|
||||
// Additional arguments can be passed after the stdin argument, as an array of
|
||||
// strings, or a sequence of varargs (if there is no stdin, null or undefined
|
||||
// can be passed):
|
||||
$EXEC("ls", undefined, "-l", "-a")
|
||||
$EXEC("ls", undefined, ["-l", "-a"])
|
||||
// Arguments can be passed as an array of strings
|
||||
$EXEC(["ls","-l","-a"]);
|
||||
|
||||
// Output of running external commands is returned from $EXEC:
|
||||
print($EXEC("ls"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user