jdk/src/linux/doc/man/jrunscript.1
author bpatel
Wed, 11 May 2011 08:30:46 -0700
changeset 9573 c02ff5a7c67b
parent 5865 47da38a8c0f0
child 21743 3d979da7bdf0
permissions -rw-r--r--
7043684: Update man pages for JDK 7 tools Reviewed-by: skannan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
     1
." Copyright (c) 2006, 2011, 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
."
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
    22
.TH jrunscript 1 "10 May 2011"
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
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
\fP\f3jrunscript\fP [ \f2options\fP ] [ arguments... ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
.SH "PARAMETERS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    40
.RS 3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
options 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
Options, if used, should follow immediately after the command name. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
arguments 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
Arguments, if used, should follow immediately after options or command name. 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    47
.RE
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    48
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
.SH "DESCRIPTION"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
\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
    54
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
\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
    57
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
.SH "OPTIONS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    60
.RS 3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
\-classpath path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
Specify where to find the user's .class files that are accessed by the script. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
\-cp path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
This is a synonym for \-classpath \f2path\fP 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
\-Dname=value 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
Set a Java system property. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
\-J<flag> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
Pass <flag> directly to the Java virtual machine on which jrunscript is run. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
\-l language 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
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
    76
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
\-e script 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
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
    79
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
\-encoding encoding 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
Specify the character encoding used while reading script files. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
\-f script\-file 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
Evaluate the given script file (batch mode). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
\-f \- 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
Read and evaluate a script from standard input (interactive mode). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
\-help\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
Output help message and exit. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
\-?\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
Output help message and exit. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
\-q\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
List all script engines available and exit. 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    97
.RE
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    98
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
.SH "ARGUMENTS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
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
   104
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
.SH "EXAMPLES"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
.LP
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   107
.SS 
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   108
Executing inline scripts
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
jrunscript \-e "print('hello world')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
jrunscript \-e "cat('http://java.sun.com')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
.LP
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   121
.SS 
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   122
Use specified language and evaluate given script file
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
jrunscript \-l js \-f test.js
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
.LP
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   133
.SS 
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   134
Interactive mode
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
jrunscript
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
.fl
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   141
js> print('Hello World\\n');
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   142
.fl
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   143
Hello World
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
.fl
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   145
js> 34 + 55
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
.fl
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   147
89.0
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
.fl
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   149
js> t = new java.lang.Thread(function() { print('Hello World\\n'); })
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   150
.fl
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   151
Thread[Thread\-0,5,main]
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
.fl
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   153
js> t.start()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
.fl
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   155
js> Hello World
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   156
.fl
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   157
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
js>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
.LP
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   165
.SS 
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   166
Run script file with script arguments
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
jrunscript test.js arg1 arg2 arg3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
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
   178
.SH "SEE ALSO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
.LP
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   181
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 
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   182
.na
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   183
\f2jsdocs\fP @
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   184
.fi
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   185
http://download.oracle.com/javase/7/docs/technotes/tools/share/jsdocs/allclasses\-noframe.html.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187