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