jdk/src/linux/doc/man/jrunscript.1
author duke
Wed, 05 Jul 2017 16:59:53 +0200
changeset 3664 0ff400405e58
parent 2692 345bc8d65b19
child 5506 202f599c92aa
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
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
."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
." CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
." have any questions.
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    21
."
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    22
.TH jrunscript 1 "04 May 2009"
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    23
." Generated from HTML by html2man (author: Eric Armstrong)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    26
.SH "Name"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
jrunscript \- command line script shell
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
.SH "SYNOPSIS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
\fP\f3jrunscript\fP [ \f2options\fP ] [ arguments... ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
.SH "PARAMETERS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    45
.RS 3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
options 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
Options, if used, should follow immediately after the command name. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
arguments 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
Arguments, if used, should follow immediately after options or command name. 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    52
.RE
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    53
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
.SH "DESCRIPTION"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
\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
    61
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
\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
    64
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
.SH "OPTIONS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
.LP
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
    69
.RS 3
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
\-classpath path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
Specify where to find the user's .class files that are accessed by the script. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
\-cp path 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
This is a synonym for \-classpath \f2path\fP 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
\-Dname=value 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
Set a Java system property. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
\-J<flag> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
Pass <flag> directly to the Java virtual machine on which jrunscript is run. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
\-l language 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
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
    85
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
\-e script 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
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
    88
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
\-encoding encoding 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
Specify the character encoding used while reading script files. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
\-f script\-file 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
Evaluate the given script file (batch mode). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
\-f \- 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
Read and evaluate a script from standard input (interactive mode). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
\-help\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
Output help message and exit. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
\-?\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
Output help message and exit. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
.TP 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
\-q\  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
List all script engines available and exit. 
2692
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   106
.RE
345bc8d65b19 6837214: Update JDK7 man pages
tbell
parents: 2
diff changeset
   107
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
.SH "ARGUMENTS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
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
   113
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
.SH "EXAMPLES"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
\f3Executing inline scripts\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
jrunscript \-e "print('hello world')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
jrunscript \-e "cat('http://java.sun.com')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
\f3Use specified language and evaluate given script file\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
jrunscript \-l js \-f test.js
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
\f3Interactive mode\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
jrunscript
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
js>print('hello world');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
hello world
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
js>34 + 55
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
89
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
js> thread(function() { print('hello world'); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
hello world
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
js>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
.RE
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
\f3Run script file with script arguments\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
.RS 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
.nf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
\f3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
jrunscript test.js arg1 arg2 arg3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
.fl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
\fP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
.fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
.RE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
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
   193
.SH "SEE ALSO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
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
   197
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
.LP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200