Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jrunscript(1) [mojave man page]

jrunscript(1)						      General Commands Manual						     jrunscript(1)

jrunscript - command line script shell SYNOPSIS
jrunscript [ options ] [ arguments... ] PARAMETERS
options Options, if used, should follow immediately after the command name. arguments Arguments, if used, should follow immediately after options or command name. DESCRIPTION
jrunscript 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. NOTE: This tool is experimental and may not be available in future versions of the JDK. OPTIONS
-classpath path Specify where to find the user's .class files that are accessed by the script. -cp path This is a synonym for -classpath path -Dname=value Set a Java system property. -Jflag Pass flag directly to the Java virtual machine on which jrunscript is run. -l language Use the specified scripting language. By default, JavaScript is used. Note that to use other scripting languages, you also need to spec- ify the corresponding script engine's jar file using -cp or -classpath option. -e script Evaluate the given script. This option can be used to run "one liner" scripts specified completely on the command line. -encoding encoding Specify the character encoding used while reading script files. -f script-file Evaluate the given script file (batch mode). -f - Read and evaluate a script from standard input (interactive mode). -help Output help message and exit. -? Output help message and exit. -q List all script engines available and exit. ARGUMENTS
If [arguments...] are present and if no -e or -f 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 -e or -f option are used, then all [arguments..] are passed as script argu- ments. If [arguments..], -e and -f are missing, interactive mode is used. Script arguments are available to a script in an engine variable named "arguments" of type String array. EXAMPLES
Executing inline scripts jrunscript -e "print('hello world')" jrunscript -e "cat('')" Use specified language and evaluate given script file jrunscript -l js -f test.js Interactive mode jrunscript js>print('hello world'); hello world js>34 + 55 89 js> thread(function() { print('hello world'); } hello world js> Run script file with script arguments jrunscript test.js arg1 arg2 arg3 test.js is script file to execute and arg1, arg2 and arg3 are passed to script as script arguments. Script can access these using "argu- ments" array. SEE ALSO
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. 06 Aug 2006 jrunscript(1)

Check Out this Related Man Page

RHINO(1)						      General Commands Manual							  RHINO(1)

rhino - invokes the JavaScript shell for running scripts in batch mode or interactive SYNOPSIS
rhino [options] script_filename_or_url [script_arguments] DESCRIPTION
This manual page documents briefly the rhino command. This manual page was written for the Debian distribution because the original pro- gram does not have a manual page. It is written according to the html documentation. rhino is a start script for the rhino JavaScript shell which provides a simple way to run scripts in batch mode or an interactive environ- ment for exploratory programming. OPTIONS
-e script_source Executes script_source as a JavaScript script. -f script_filename_or_url Reads script_filename_or_url content and execute it as a JavaScript script. -opt, -O optLevel Optimizes at level optLevel, which must be an integer between -1 and 9. -1 means Interpretive mode is always used. 0 means no opti- mizations whereas 9 means all optimizations are performed. -version versionNumber Specifies the language version to compile with. The string versionNumber must be one of 100, 110, 120, 130, or 140. See JavaScript Language Versions for more information on language versions. -strict Enable strict mode. PREDEFINED PROPERTIES
Scripts executing in the shell have access to some additional properties of the top-level object. arguments The arguments object is an array containing the strings of all the arguments given at the command line when the shell was invoked. help() Executing the help function will print usage and help messages. defineClass(className) Define an extension using the Java class named with the string argument className. Uses ScriptableObject.defineClass() to define the extension. deserialize(filename) Restore from the specified file an object previously written by a call to serialize. load([filename,...]) Load JavaScript source files named by string arguments. If multiple arguments are given, each file is read in and executed in turn. loadClass(className) Load and execute the class named by the string argument className. The class must be a class that implements the Script interface, as will any script compiled by jsc. print([expr...]) Evaluate and print expressions. Evaluates each expression, converts the result to a string, and prints it. readFile(path[,characterCoding]) Read given file and convert its bytes to a string using the specified character coding or default character coding if explicit cod- ing argument is not given. readUrl(url[,characterCoding]) Open an input connection to the given string url, read all its bytes and convert them to a string using the specified character cod- ing or default character coding if explicit coding argument is not given. runCommand(commandName,[arg,...][options]) Execute the specified command with the given argument and options as a separate process and return the exit status of the process. For details, see JavaDoc for serialize(object,filename) Serialize the given object to the specified file. spawn(functionOrScript) Run the given function or script in a different thread. sync(function) creates a synchronized function (in the sense of a Java synchronized method) from an existing function. The new function synchro- nizes on the this object of its invocation. quit() Quit shell. The shell will also quit in interactive mode if an end-of-file character is typed at the prompt. version([number]) Get or set JavaScript version number. If no argument is supplied, the current version number is returned. If an argument is sup- plied, it is expected to be one of 100, 110, 120, 130, or 140 to indicate JavaScript version 1.0, 1.1, 1.2, 1.3, or 1.4 respec- tively. SEE ALSO
The online documentation under AUTHOR
This manual page was written by Wolfgang Baer <>, for the Debian project (but may be used by others). February 12, 2005 RHINO(1)
Man Page

Featured Tech Videos