jrunscript をコマンドシェルから使う
□引数の参照
jrunscript - コマンド行スクリプトシェル
スクリプト引数を指定してスクリプトファイルを実行する
jrunscript test.js arg1 arg2 arg3
この arg1,arg2,arg3 はスクリプトからそれぞれ arguments[0],arguments[1],arguments[2] として参照できる。
□jrunscript の intaractive mode から script file を実行する
Function
hello.js
print("Hello World!\n");
shell(Windows "cmd.exe")で実行
C:\Documents and Settings\user>jrunscript js> load("hello.js") Hello World! js>
□ システムコマンドを実行し、結果を表示する。
Function exec void exec(cmd)
Windows のコマンドプロンプトでは cmd.exe と Jascript 実行環境の encoding の違いにより文字化けする
C:\Documents and Settings\user>jrunscript js> exec("help") ???????R?}???h?????×???????A"HELP ?R?}???h??" ???????μ?????????¢ (以下省略)