jdk/src/linux/doc/man/ja/jrunscript.1
author jjg
Tue, 11 Mar 2008 13:14:55 -0700
changeset 168 25697c18650b
parent 2 90ce3da70b43
child 2692 345bc8d65b19
permissions -rw-r--r--
6307187: clean up code for -Xlint:options Summary: introduce common code for handling one-of and any-of options Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
.'" t
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
." This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
." under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
." published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
." This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
." FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
." version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
." accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
." You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
." 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
." CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
." have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
." `
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
.TH jrunscript 1 "2006 年 9 月 4 日" "Java SE 6" "ユーザーコマンド"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
." Generated by html2roff
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
.SH 名前
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
jrunscript \- コマンド行スクリプトシェル
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
.SH "形式"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
\fP\f3jrunscript\fP [ \f2options\fP ] [ arguments... ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
.SH "パラメータ"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
options 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
オプションを使用する場合、コマンド名の直後に記述してください。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
arguments 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
引数を使用する場合、オプションまたはコマンド名の直後に記述してください。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
.SH "説明"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
\f3jrunscript\fP はコマンド行スクリプトシェルです。jrunscript は、対話型 (読み取り \- 評価 \- 出力) モードとバッチ (\-f オプション) モードの両方のスクリプト実行をサポートします。これはスクリプト言語に依存しないシェルです。デフォルトの使用言語は JavaScript ですが、\-l オプションを使えばほかの言語も指定できます。jrunscript は、Java とスクリプト言語との通信によって「探求的なプログラミング」スタイルをサポートします。
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
\f3注:\fP このツールは試験的なものであり、JDK の将来のバージョンでは使用できない可能性があります。
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
.SH "オプション"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
\-classpath path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
スクリプトからのアクセス対象となるユーザの .class ファイルの検索場所を指定します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
\-cp path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
\-classpath \f2path\fP と同義です。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
\-Dname=value 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
Java のシステムプロパティを設定します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
\-J<flag> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
jrunscript が実行されている Java 仮想マシンに、直接 <flag> を渡します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
\-l language 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
指定されたスクリプト言語を使用します。デフォルトでは JavaScript が使用されます。ほかのスクリプト言語を使用するには、対応するスクリプトエンジンの JAR ファイルも指定する必要があります。それには、\-cp、\-classpath のいずれかのオプションを使用します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
\-e script 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
指定されたスクリプトを評価します。このオプションを使えば、コマンド行にすべてが指定された「1 行」スクリプトを実行できます。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
\-encoding encoding 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
スクリプトファイルの読み取り時に使用する文字エンコーディングを指定します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
\-f script\-file 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
指定されたスクリプトファイルを評価します (バッチモード)。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
\-f \- 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
標準入力からスクリプトを読み取り、それを評価します (対話型モード)。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
\-help\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
ヘルプメッセージを出力したあと、終了します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
\-?\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
ヘルプメッセージを出力したあと、終了します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
\-q\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
利用可能なすべてのスクリプトエンジンを一覧表示したあと、終了します。 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
.SH "引数"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
[arguments...] が存在していて、かつ \f3\-e\fP、\f3\-f\fP のいずれのオプションも使用されなかった場合、最初の引数がスクリプトファイルとなり、他の引数が存在する場合はスクリプト引数として渡されます。[arguments..] が使用され、かつ \f3\-e\fP、\f3\-f\fP のいずれかのオプションが使用された場合、すべての [arguments..] がスクリプト引数として渡されます。[arguments..]、\f3\-e\fP、\f3\-f\fP がどれも存在しなかった場合は、対話型モードが使用されます。スクリプトからスクリプト引数を使用するには、「arguments」という名前の String 配列型のエンジン変数を使用します。
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
.SH "例"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
\f3インラインスクリプトの実行\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    jrunscript \-e "print('hello world')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    jrunscript \-e "cat('http://java.sun.com')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
\f3指定された言語を使用し、指定されたスクリプトファイルを評価する\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    jrunscript \-l js \-f test.js
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
\f3対話型モード\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    jrunscript
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    js>print('hello world');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    hello world
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    js>34 + 55
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    js> thread(function() { print('hello world'); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    hello world
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    js>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
\f3スクリプト引数を指定してスクリプトファイルを実行する\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    jrunscript test.js arg1 arg2 arg3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
test.js が実行対象となるスクリプトファイルであり、arg1、arg2、および arg3 はスクリプト引数としてスクリプトに渡されます。スクリプトは「arguments」配列を使ってこれらにアクセスできます。  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
.SH "関連項目"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
JavaScript が使用される場合、jrunscript は、最初のユーザ定義スクリプトを評価する前に、いくつかの組み込み関数や組み込みオブジェクトを初期化します。これらの JavaScript 組み込み機能については、jsdocs を参照してください。
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185