jdk/src/linux/doc/man/jrunscript.1
author michaelm
Thu, 13 Jan 2011 11:01:30 +0000
changeset 7980 3af394bb6f59
parent 5865 47da38a8c0f0
child 9573 c02ff5a7c67b
permissions -rw-r--r--
6896088: URLClassLoader.close() apparently not working for JAR URLs on Windows Reviewed-by: chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5865
47da38a8c0f0 6955341: Oracle rebranding changes for man pages
bpatel
parents: 5506
diff changeset
     1
." Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
." This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
." under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
." published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
." This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
." FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
." version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
." accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
." You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
." 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
."
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2692
diff changeset
    18
." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2692
diff changeset
    19
." or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2692
diff changeset
    20
." questions.
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    21
."
5865
47da38a8c0f0 6955341: Oracle rebranding changes for man pages
bpatel
parents: 5506
diff changeset
    22
.TH jrunscript 1 "02 Jun 2010"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    25
.SH "Name"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
jrunscript \- command line script shell
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
.SH "SYNOPSIS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
\fP\f3jrunscript\fP [ \f2options\fP ] [ arguments... ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
.SH "PARAMETERS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    44
.RS 3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
options 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
Options, if used, should follow immediately after the command name. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
arguments 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
Arguments, if used, should follow immediately after options or command name. 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    51
.RE
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    52
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
.SH "DESCRIPTION"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
\f3jrunscript\fP is a command line script shell. jrunscript supports both an interactive (read\-eval\-print) mode and a batch (\-f option) mode of script execution. This is a scripting language independent shell. By default, JavaScript is the language used, but the \-l option can be used to specify a different language. Through Java to scripting language communication, jrunscript supports "exploratory programming" style.
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
\f3NOTE:\fP This tool is \f3experimental\fP and may \f3not\fP be available in future versions of the JDK.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
.SH "OPTIONS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    68
.RS 3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
\-classpath path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
Specify where to find the user's .class files that are accessed by the script. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
\-cp path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
This is a synonym for \-classpath \f2path\fP 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
\-Dname=value 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
Set a Java system property. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
\-J<flag> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
Pass <flag> directly to the Java virtual machine on which jrunscript is run. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
\-l language 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
Use the specified scripting language. By default, JavaScript is used. Note that to use other scripting languages, you also need to specify the corresponding script engine's jar file using \-cp or \-classpath option. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
\-e script 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
Evaluate the given script. This option can be used to run "one liner" scripts specified completely on the command line. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
\-encoding encoding 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
Specify the character encoding used while reading script files. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
\-f script\-file 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
Evaluate the given script file (batch mode). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
\-f \- 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
Read and evaluate a script from standard input (interactive mode). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
\-help\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
Output help message and exit. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
\-?\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
Output help message and exit. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
\-q\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
List all script engines available and exit. 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   105
.RE
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   106
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
.SH "ARGUMENTS"
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
If [arguments...] are present and if no \f3\-e\fP or \f3\-f\fP option is used, then the first argument is the script file and the rest of the arguments, if any, are passed as script arguments. If [arguments..] and \f3\-e\fP or \f3\-f\fP option are used, then all [arguments..] are passed as script arguments. If [arguments..], \f3\-e\fP and \f3\-f\fP are missing, interactive mode is used. Script arguments are available to a script in an engine variable named "arguments" of type String array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
.SH "EXAMPLES"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
\f3Executing inline scripts\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
jrunscript \-e "print('hello world')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
jrunscript \-e "cat('http://java.sun.com')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
\f3Use specified language and evaluate given script file\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
jrunscript \-l js \-f test.js
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
\f3Interactive mode\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
jrunscript
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
js>print('hello world');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
hello world
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
js>34 + 55
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
89
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
js> thread(function() { print('hello world'); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
hello world
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
js>
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
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
\f3Run script file with script arguments\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
jrunscript test.js arg1 arg2 arg3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
test.js is script file to execute and arg1, arg2 and arg3 are passed to script as script arguments. Script can access these using "arguments" array.  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
.SH "SEE ALSO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
If JavaScript is used, then before evaluating any user defined script, jrunscript initializes certain built\-in functions and objects. These JavaScript built\-ins are documented in jsdocs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197