1 '\" t
   2 .\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
   3 .\" Title: jrunscript
   4 .\" Language: English
   5 .\" Date: 2013年11月21日
   6 .\" SectDesc: スクリプティング・ツール
   7 .\" Software: JDK 8
   8 .\" Arch: 汎用
   9 .\"
  10 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  11 .\"
  12 .\" This code is free software; you can redistribute it and/or modify it
  13 .\" under the terms of the GNU General Public License version 2 only, as
  14 .\" published by the Free Software Foundation.
  15 .\"
  16 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  17 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  18 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  19 .\" version 2 for more details (a copy is included in the LICENSE file that
  20 .\" accompanied this code).
  21 .\"
  22 .\" You should have received a copy of the GNU General Public License version
  23 .\" 2 along with this work; if not, write to the Free Software Foundation,
  24 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  25 .\"
  26 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  27 .\" or visit www.oracle.com if you need additional information or have any
  28 .\" questions.
  29 .\"
  30 .pl 99999
  31 .TH "jrunscript" "1" "2013年11月21日" "JDK 8" "スクリプティング・ツール"
  32 .\" -----------------------------------------------------------------
  33 .\" * Define some portability stuff
  34 .\" -----------------------------------------------------------------
  35 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36 .\" http://bugs.debian.org/507673
  37 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  38 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39 .ie \n(.g .ds Aq \(aq
  40 .el       .ds Aq '
  41 .\" -----------------------------------------------------------------
  42 .\" * set default formatting
  43 .\" -----------------------------------------------------------------
  44 .\" disable hyphenation
  45 .nh
  46 .\" disable justification (adjust text to left margin only)
  47 .ad l
  48 .\" -----------------------------------------------------------------
  49 .\" * MAIN CONTENT STARTS HERE *
  50 .\" -----------------------------------------------------------------
  51 .SH "NAME"
  52 jrunscript \- 対話型モードとバッチ・モードをサポートするコマンドライン・スクリプト・シェルを実行します。このコマンドは試験的なもので、サポートされていません。
  53 .SH "概要"
  54 .sp
  55 .if n \{\
  56 .RS 4
  57 .\}
  58 .nf
  59 \fIjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
  60 .fi
  61 .if n \{\
  62 .RE
  63 .\}
  64 .PP
  65 \fIoptions\fR
  66 .RS 4
  67 コマンドライン・オプション。オプションを参照してください。
  68 .RE
  69 .PP
  70 \fIarguments\fR
  71 .RS 4
  72 引数を使用する場合、オプションまたはコマンド名の直後に記述してください。引数を参照してください。
  73 .RE
  74 .SH "説明"
  75 .PP
  76 \fIjrunscript\fRコマンドは、言語に依存しないコマンドライン・スクリプト・シェルです。\fIjrunscript\fRは、対話型(read\-eval\-print)モードとバッチ(\fI\-f\fRオプション)・モードの両方のスクリプト実行をサポートします。デフォルトの使用言語はJavaScriptですが、\fI\-l\fRオプションを使用すれば他の言語も指定できます。\fIjrunscript\fRコマンドは、Javaとスクリプト言語との通信を使用して探求的なプログラミング・スタイルをサポートします。
  77 .SH "オプション"
  78 .PP
  79 \-classpath \fIpath\fR
  80 .RS 4
  81 スクリプトがアクセスする必要のあるクラス・ファイルの場所を示します。
  82 .RE
  83 .PP
  84 \-cp \fIpath\fR
  85 .RS 4
  86 \fI\-classpath\fR
  87 \fIpath\fRと同じです。
  88 .RE
  89 .PP
  90 \-D\fIname\fR=\fIvalue\fR
  91 .RS 4
  92 Javaのシステム・プロパティを設定します。
  93 .RE
  94 .PP
  95 \-J\fIflag\fR
  96 .RS 4
  97 \fIflag\fRを、\fIjrunscript\fRコマンドが実行されているJava仮想マシンに直接渡します。
  98 .RE
  99 .PP
 100 \-I \fIlanguage\fR
 101 .RS 4
 102 指定されたスクリプト言語を使用します。デフォルトではJavaScriptが使用されます。他のスクリプト言語を使用するには、\fI\-cp\fRまたは\fI\-classpath\fRオプションを使用して、対応するスクリプト・エンジンのJARファイルを指定する必要があります。
 103 .RE
 104 .PP
 105 \-e \fIscript\fR
 106 .RS 4
 107 指定されたスクリプトを評価します。このオプションを使用すれば、コマンドラインにすべてが指定された1行スクリプトを実行できます。
 108 .RE
 109 .PP
 110 \-encoding \fIencoding\fR
 111 .RS 4
 112 スクリプト・ファイルの読取り時に使用する文字エンコーディングを指定します。
 113 .RE
 114 .PP
 115 \-f \fIscript\-file\fR
 116 .RS 4
 117 指定されたスクリプト・ファイル(バッチ・モード)を評価します。
 118 .RE
 119 .PP
 120 \-f \-
 121 .RS 4
 122 標準入力からスクリプトを読み取り、それを評価します(対話型モード)。
 123 .RE
 124 .PP
 125 \-help
 126 .RS 4
 127 ヘルプ・メッセージを表示して終了します。
 128 .RE
 129 .PP
 130 \-?
 131 .RS 4
 132 ヘルプ・メッセージを表示して終了します。
 133 .RE
 134 .PP
 135 \-q
 136 .RS 4
 137 利用可能なすべてのスクリプト・エンジンを一覧表示したあと、終了します。
 138 .RE
 139 .SH "引数"
 140 .PP
 141 argumentsが存在していて、かつ\fI\-e\fR、\fI\-f\fRのいずれのオプションも使用されなかった場合、最初の引数がスクリプト・ファイルとなり、他の引数が存在する場合はスクリプトに渡されます。argumentsと、\fI\-e\fRまたは\fI\-f\fRオプションが使用されている場合、すべてのargumentsがスクリプトに渡されます。arguments、\fI\-e\fR、\fI\-f\fRがどれも存在しなかった場合は、対話型モードが使用されます。スクリプトからスクリプト引数を使用するには、\fIarguments\fRという名前の\fIString\fR配列型のエンジン変数を使用します。
 142 .SH "例"
 143 .SS "インライン・スクリプトの実行"
 144 .sp
 145 .if n \{\
 146 .RS 4
 147 .\}
 148 .nf
 149 jrunscript \-e "print(\*(Aqhello world\*(Aq)"
 150 jrunscript \-e "cat(\*(Aqhttp://www\&.example\&.com\*(Aq)"
 151 .fi
 152 .if n \{\
 153 .RE
 154 .\}
 155 .SS "指定された言語の使用およびスクリプト・ファイルの評価"
 156 .sp
 157 .if n \{\
 158 .RS 4
 159 .\}
 160 .nf
 161 jrunscript \-l js \-f test\&.js
 162 .fi
 163 .if n \{\
 164 .RE
 165 .\}
 166 .SS "対話型モード"
 167 .sp
 168 .if n \{\
 169 .RS 4
 170 .\}
 171 .nf
 172 jrunscript
 173 js> print(\*(AqHello World\en\*(Aq);
 174 Hello World
 175 js> 34 + 55
 176 89\&.0
 177 js> t = new java\&.lang\&.Thread(function() { print(\*(AqHello World\en\*(Aq); })
 178 Thread[Thread\-0,5,main]
 179 js> t\&.start()
 180 js> Hello World
 181  
 182 js>
 183 .fi
 184 .if n \{\
 185 .RE
 186 .\}
 187 .SS "スクリプト引数を指定したスクリプト・ファイルの実行"
 188 .PP
 189 test\&.jsファイルはスクリプト・ファイルです。\fIarg1\fR、\fIarg2\fRおよび\fIarg3\fRの各引数がスクリプトに渡されます。スクリプトはarguments配列を使用してこれらの引数にアクセスできます。
 190 .sp
 191 .if n \{\
 192 .RS 4
 193 .\}
 194 .nf
 195 jrunscript test\&.js arg1 arg2 arg3
 196 .fi
 197 .if n \{\
 198 .RE
 199 .\}
 200 .SH "関連項目"
 201 .PP
 202 JavaScriptが使用される場合、ユーザー定義スクリプトを評価する前に、\fIjrunscript\fRコマンドはいくつかの組込み関数や組込みオブジェクトを初期化します。これらのJavaScriptの組込みについては、http://code\&.google\&.com/p/jsdoc\-toolkit/にある
 203 JsDoc\-Toolkitを参照してください。
 204 .br
 205 'pl 8.5i
 206 'bp