From de9651c66a6ecb012c76fdc7742e6a9c74c1e004 Mon Sep 17 00:00:00 2001 From: Priya Lakshmi Muthuswamy Date: Fri, 22 Sep 2017 12:00:41 +0200 Subject: [PATCH] 8181792: nashorn samples/exec.js has some incorrect examples Reviewed-by: sundar, hannesw --- src/sample/nashorn/exec.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sample/nashorn/exec.js b/src/sample/nashorn/exec.js index d10b621639b..913b3deb0d3 100644 --- a/src/sample/nashorn/exec.js +++ b/src/sample/nashorn/exec.js @@ -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"))