|
19 | 19 | .\" or visit www.oracle.com if you need additional information or have any
|
20 | 20 | .\" questions.
|
21 | 21 | .\"
|
22 |
| -.\" Automatically generated by Pandoc 2.3.1 |
| 22 | +.\" Automatically generated by Pandoc 2.19.2 |
23 | 23 | .\"
|
24 |
| -.TH "JRUNSCRIPT" "1" "2023" "JDK 20\-ea" "JDK Commands" |
| 24 | +.\" Define V font for inline verbatim, using C font in formats |
| 25 | +.\" that render this, and otherwise B font. |
| 26 | +.ie "\f[CB]x\f[R]"x" \{\ |
| 27 | +. ftr V B |
| 28 | +. ftr VI BI |
| 29 | +. ftr VB B |
| 30 | +. ftr VBI BI |
| 31 | +.\} |
| 32 | +.el \{\ |
| 33 | +. ftr V CR |
| 34 | +. ftr VI CI |
| 35 | +. ftr VB CB |
| 36 | +. ftr VBI CBI |
| 37 | +.\} |
| 38 | +.TH "JRUNSCRIPT" "1" "2023" "JDK 20-ea" "JDK Commands" |
25 | 39 | .hy
|
26 | 40 | .SH NAME
|
27 | 41 | .PP
|
28 |
| -jrunscript \- run a command\-line script shell that supports interactive |
| 42 | +jrunscript - run a command-line script shell that supports interactive |
29 | 43 | and batch modes
|
30 | 44 | .SH SYNOPSIS
|
31 | 45 | .PP
|
32 | 46 | \f[B]Note:\f[R]
|
33 | 47 | .PP
|
34 | 48 | This tool is \f[B]experimental\f[R] and unsupported.
|
35 | 49 | .PP
|
36 |
| -\f[CB]jrunscript\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]] |
| 50 | +\f[V]jrunscript\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]] |
37 | 51 | .TP
|
38 |
| -.B \f[I]options\f[R] |
39 |
| -This represents the \f[CB]jrunscript\f[R] command\-line options that can |
| 52 | +\f[I]options\f[R] |
| 53 | +This represents the \f[V]jrunscript\f[R] command-line options that can |
40 | 54 | be used.
|
41 | 55 | See \f[B]Options for the jrunscript Command\f[R].
|
42 |
| -.RS |
43 |
| -.RE |
44 | 56 | .TP
|
45 |
| -.B \f[I]arguments\f[R] |
| 57 | +\f[I]arguments\f[R] |
46 | 58 | Arguments, when used, follow immediately after options or the command
|
47 | 59 | name.
|
48 | 60 | See \f[B]Arguments\f[R].
|
49 |
| -.RS |
50 |
| -.RE |
51 | 61 | .SH DESCRIPTION
|
52 | 62 | .PP
|
53 |
| -The \f[CB]jrunscript\f[R] command is a language\-independent command\-line |
| 63 | +The \f[V]jrunscript\f[R] command is a language-independent command-line |
54 | 64 | script shell.
|
55 |
| -The \f[CB]jrunscript\f[R] command supports both an interactive |
56 |
| -(read\-eval\-print) mode and a batch (\f[CB]\-f\f[R] option) mode of |
57 |
| -script execution. |
58 |
| -By default, JavaScript is the language used, but the \f[CB]\-l\f[R] option |
| 65 | +The \f[V]jrunscript\f[R] command supports both an interactive |
| 66 | +(read-eval-print) mode and a batch (\f[V]-f\f[R] option) mode of script |
| 67 | +execution. |
| 68 | +By default, JavaScript is the language used, but the \f[V]-l\f[R] option |
59 | 69 | can be used to specify a different language.
|
60 | 70 | By using Java to scripting language communication, the
|
61 |
| -\f[CB]jrunscript\f[R] command supports an exploratory programming style. |
| 71 | +\f[V]jrunscript\f[R] command supports an exploratory programming style. |
62 | 72 | .PP
|
63 | 73 | If JavaScript is used, then before it evaluates a user defined script,
|
64 |
| -the \f[CB]jrunscript\f[R] command initializes certain built\-in functions |
| 74 | +the \f[V]jrunscript\f[R] command initializes certain built-in functions |
65 | 75 | and objects, which are documented in the API Specification for
|
66 |
| -\f[CB]jrunscript\f[R] JavaScript built\-in functions. |
| 76 | +\f[V]jrunscript\f[R] JavaScript built-in functions. |
67 | 77 | .SH OPTIONS FOR THE JRUNSCRIPT COMMAND
|
68 | 78 | .TP
|
69 |
| -.B \f[CB]\-cp\f[R] \f[I]path\f[R] or \f[CB]\-classpath\f[R] \f[I]path\f[R] |
| 79 | +\f[V]-cp\f[R] \f[I]path\f[R] or \f[V]-classpath\f[R] \f[I]path\f[R] |
70 | 80 | Indicates where any class files are that the script needs to access.
|
71 |
| -.RS |
72 |
| -.RE |
73 | 81 | .TP
|
74 |
| -.B \f[CB]\-D\f[R]\f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R] |
| 82 | +\f[V]-D\f[R]\f[I]name\f[R]\f[V]=\f[R]\f[I]value\f[R] |
75 | 83 | Sets a Java system property.
|
76 |
| -.RS |
77 |
| -.RE |
78 | 84 | .TP
|
79 |
| -.B \f[CB]\-J\f[R]\f[I]flag\f[R] |
| 85 | +\f[V]-J\f[R]\f[I]flag\f[R] |
80 | 86 | Passes \f[I]flag\f[R] directly to the Java Virtual Machine where the
|
81 |
| -\f[CB]jrunscript\f[R] command is running. |
82 |
| -.RS |
83 |
| -.RE |
| 87 | +\f[V]jrunscript\f[R] command is running. |
84 | 88 | .TP
|
85 |
| -.B \f[CB]\-l\f[R] \f[I]language\f[R] |
| 89 | +\f[V]-l\f[R] \f[I]language\f[R] |
86 | 90 | Uses the specified scripting language.
|
87 | 91 | By default, JavaScript is used.
|
88 | 92 | To use other scripting languages, you must specify the corresponding
|
89 |
| -script engine\[aq]s JAR file with the \f[CB]\-cp\f[R] or |
90 |
| -\f[CB]\-classpath\f[R] option. |
91 |
| -.RS |
92 |
| -.RE |
| 93 | +script engine\[aq]s JAR file with the \f[V]-cp\f[R] or |
| 94 | +\f[V]-classpath\f[R] option. |
93 | 95 | .TP
|
94 |
| -.B \f[CB]\-e\f[R] \f[I]script\f[R] |
| 96 | +\f[V]-e\f[R] \f[I]script\f[R] |
95 | 97 | Evaluates the specified script.
|
96 |
| -This option can be used to run one\-line scripts that are specified |
| 98 | +This option can be used to run one-line scripts that are specified |
97 | 99 | completely on the command line.
|
98 |
| -.RS |
99 |
| -.RE |
100 | 100 | .TP
|
101 |
| -.B \f[CB]\-encoding\f[R] \f[I]encoding\f[R] |
| 101 | +\f[V]-encoding\f[R] \f[I]encoding\f[R] |
102 | 102 | Specifies the character encoding used to read script files.
|
103 |
| -.RS |
104 |
| -.RE |
105 | 103 | .TP
|
106 |
| -.B \f[CB]\-f\f[R] \f[I]script\-file\f[R] |
| 104 | +\f[V]-f\f[R] \f[I]script-file\f[R] |
107 | 105 | Evaluates the specified script file (batch mode).
|
108 |
| -.RS |
109 |
| -.RE |
110 | 106 | .TP
|
111 |
| -.B \f[CB]\-f\ \-\f[R] |
| 107 | +\f[V]-f -\f[R] |
112 | 108 | Enters interactive mode to read and evaluate a script from standard
|
113 | 109 | input.
|
114 |
| -.RS |
115 |
| -.RE |
116 | 110 | .TP
|
117 |
| -.B \f[CB]\-help\f[R] or \f[CB]\-?\f[R] |
| 111 | +\f[V]-help\f[R] or \f[V]-?\f[R] |
118 | 112 | Displays a help message and exits.
|
119 |
| -.RS |
120 |
| -.RE |
121 | 113 | .TP
|
122 |
| -.B \f[CB]\-q\f[R] |
| 114 | +\f[V]-q\f[R] |
123 | 115 | Lists all script engines available and exits.
|
124 |
| -.RS |
125 |
| -.RE |
126 | 116 | .SH ARGUMENTS
|
127 | 117 | .PP
|
128 |
| -If arguments are present and if no \f[CB]\-e\f[R] or \f[CB]\-f\f[R] option |
| 118 | +If arguments are present and if no \f[V]-e\f[R] or \f[V]-f\f[R] option |
129 | 119 | is used, then the first argument is the script file and the rest of the
|
130 | 120 | arguments, if any, are passed as script arguments.
|
131 |
| -If arguments and the \f[CB]\-e\f[R] or the \f[CB]\-f\f[R] option are used, |
| 121 | +If arguments and the \f[V]-e\f[R] or the \f[V]-f\f[R] option are used, |
132 | 122 | then all arguments are passed as script arguments.
|
133 |
| -If arguments \f[CB]\-e\f[R] and \f[CB]\-f\f[R] are missing, then the |
| 123 | +If arguments \f[V]-e\f[R] and \f[V]-f\f[R] are missing, then the |
134 | 124 | interactive mode is used.
|
135 | 125 | .SH EXAMPLE OF EXECUTING INLINE SCRIPTS
|
136 | 126 | .RS
|
137 | 127 | .PP
|
138 |
| -\f[CB]jrunscript\ \-e\ "print(\[aq]hello\ world\[aq])"\f[R] |
| 128 | +\f[V]jrunscript -e \[dq]print(\[aq]hello world\[aq])\[dq]\f[R] |
139 | 129 | .RE
|
140 | 130 | .RS
|
141 | 131 | .PP
|
142 |
| -\f[CB]jrunscript\ \-e\ "cat(\[aq]http://www.example.com\[aq])"\f[R] |
| 132 | +\f[V]jrunscript -e \[dq]cat(\[aq]http://www.example.com\[aq])\[dq]\f[R] |
143 | 133 | .RE
|
144 | 134 | .SH EXAMPLE OF USING SPECIFIED LANGUAGE AND EVALUATE THE SCRIPT FILE
|
145 | 135 | .RS
|
146 | 136 | .PP
|
147 |
| -\f[CB]jrunscript\ \-l\ js\ \-f\ test.js\f[R] |
| 137 | +\f[V]jrunscript -l js -f test.js\f[R] |
148 | 138 | .RE
|
149 | 139 | .SH EXAMPLE OF INTERACTIVE MODE
|
150 | 140 | .IP
|
151 | 141 | .nf
|
152 | 142 | \f[CB]
|
153 | 143 | jrunscript
|
154 |
| -js>\ print(\[aq]Hello\ World\\n\[aq]); |
155 |
| -Hello\ World |
156 |
| -js>\ 34\ +\ 55 |
| 144 | +js> print(\[aq]Hello World\[rs]n\[aq]); |
| 145 | +Hello World |
| 146 | +js> 34 + 55 |
157 | 147 | 89.0
|
158 |
| -js>\ t\ =\ new\ java.lang.Thread(function()\ {\ print(\[aq]Hello\ World\\n\[aq]);\ }) |
159 |
| -Thread[Thread\-0,5,main] |
160 |
| -js>\ t.start() |
161 |
| -js>\ Hello\ World |
| 148 | +js> t = new java.lang.Thread(function() { print(\[aq]Hello World\[rs]n\[aq]); }) |
| 149 | +Thread[Thread-0,5,main] |
| 150 | +js> t.start() |
| 151 | +js> Hello World |
162 | 152 |
|
163 | 153 | js>
|
164 | 154 | \f[R]
|
165 | 155 | .fi
|
166 | 156 | .SH RUN SCRIPT FILE WITH SCRIPT ARGUMENTS
|
167 | 157 | .PP
|
168 |
| -In this example, the \f[CB]test.js\f[R] file is the script file. |
169 |
| -The \f[CB]arg1\f[R], \f[CB]arg2\f[R], and \f[CB]arg3\f[R] arguments are passed |
170 |
| -to the script. |
| 158 | +In this example, the \f[V]test.js\f[R] file is the script file. |
| 159 | +The \f[V]arg1\f[R], \f[V]arg2\f[R], and \f[V]arg3\f[R] arguments are |
| 160 | +passed to the script. |
171 | 161 | The script can access these arguments with an arguments array.
|
172 | 162 | .RS
|
173 | 163 | .PP
|
174 |
| -\f[CB]jrunscript\ test.js\ arg1\ arg2\ arg3\f[R] |
| 164 | +\f[V]jrunscript test.js arg1 arg2 arg3\f[R] |
175 | 165 | .RE
|
0 commit comments