t
Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.

This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.

This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).

You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.

Arch: generic
Software: JDK 8
Date: 21 November 2013
SectDesc: Scripting Tools
Title: jrunscript.1

jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
-----------------------------------------------------------------
* Define some portability stuff
-----------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://bugs.debian.org/507673
http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------
* set default formatting
-----------------------------------------------------------------
disable hyphenation
disable justification (adjust text to left margin only)
-----------------------------------------------------------------
* MAIN CONTENT STARTS HERE *
-----------------------------------------------------------------
NAME
jrunscript - Runs a command-line script shell that supports interactive and batch modes. This command is experimental and unsupported.
SYNOPSIS
 

jrunscript [options] [arguments]

options The command-line options. See Options.

arguments Arguments, when used, follow immediately after options or the command name. See Arguments.

DESCRIPTION
The \f3jrunscript command is a language-independent command-line script shell. The \f3jrunscript command supports both an interactive (read-eval-print) mode and a batch (\f3-f option) mode of script execution. By default, JavaScript is the language used, but the \f3-l option can be used to specify a different language. By using Java to scripting language communication, the \f3jrunscript command supports an exploratory programming style.
OPTIONS

-classpath path

Indicate where any class files are that the script needs to access.

-cp path

Same as \f3-classpath\f3path.

-Dname=value

Sets a Java system property.

-Jflag

Passes \f3flag directly to the Java Virtual Machine where the \f3jrunscript command is running.

-I language

Uses the specified scripting language. By default, JavaScript is used. To use other scripting languages, you must specify the corresponding script engine's JAR file with the \f3-cp or \f3-classpath option.

-e script

Evaluates the specified script. This option can be used to run one-line scripts that are specified completely on the command line.

-encoding encoding

Specifies the character encoding used to read script files.

-f script-file

Evaluates the specified script file (batch mode).

-f -

Reads and evaluates a script from standard input (interactive mode).

-help

Displays a help message and exits.

-?

Displays a help message and exits.

-q

Lists all script engines available and exits.

ARGUMENTS
If arguments are present and if no \f3-e or \f3-f option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script. If arguments and \f3-e or the \f3-f option are used, then all arguments are passed to the script. If arguments, \f3-e and \f3-f are missing, then interactive mode is used. Script arguments are available to a script in an engine variable named \f3arguments of type \f3String array.
EXAMPLES
EXECUTE INLINE SCRIPTS
 
\f3jrunscript -e "print('hello world')"
 
\f3jrunscript -e "cat('http://www.example.com')"
 
\f3
USE SPECIFIED LANGUAGE AND EVALUATE THE SCRIPT FILE
 
\f3jrunscript -l js -f test.js
 
\f3
INTERACTIVE MODE
 
\f3jrunscript
 
\f3js> print('Hello World\en');
 
\f3Hello World
 
\f3js> 34 + 55
 
\f389.0
 
\f3js> t = new java.lang.Thread(function() { print('Hello World\en'); })
 
\f3Thread[Thread-0,5,main]
 
\f3js> t.start()
 
\f3js> Hello World
 
\f3
 
\f3js>
 
\f3
RUN SCRIPT FILE WITH SCRIPT ARGUMENTS
The test.js file is the script file. The \f3arg1, \f3arg2 and \f3arg3 arguments are passed to the script. The script can access these arguments with an arguments array.
 
\f3jrunscript test.js arg1 arg2 arg3
 
\f3
SEE ALSO
If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript command initializes certain built-in functions and objects. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code.google.com/p/jsdoc-toolkit/

'pl 8.5i 'bp