From 1a42889cdffdcd7bfdb576e14815617a5530feaa Mon Sep 17 00:00:00 2001 From: "igor%mir2.org" Date: Sat, 27 Aug 2005 21:16:14 +0000 Subject: [PATCH] Added Windows-specific examples using runCommand git-svn-id: svn://10.0.0.236/trunk@179142 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/rhino/docs/shell.html | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/mozilla/js/rhino/docs/shell.html b/mozilla/js/rhino/docs/shell.html index 62e576c7b77..d83f0cc4dbd 100644 --- a/mozilla/js/rhino/docs/shell.html +++ b/mozilla/js/rhino/docs/shell.html @@ -248,9 +248,26 @@ js> runCommand("echo", { args: arg_array}) 1 2 3 4 0 - - - +

+Examples for Windows are similar: +

+js> // Invoke shell command
+js> runCommand("cmd", "/C", "date /T")
+27.08.2005
+0
+js> // Run sort collectiong the output 
+js> var opt={input: "c\na\nb", output: 'Sort Output:\n'}
+js> runCommand("sort", opt)
+0
+js> print(opt.output)
+Sort Output:
+a
+b
+c
+js> // Invoke notepad and wait until it exits
+js> runCommand("notepad")
+0
+


back to top