NAME
jrunscript - command line script shell
SYNOPSIS
jjrruunnssccrriipptt [ options ] [ arguments... ] PPAARRAAMMEETTEERRSS options Options, if used, should follow immediately after the command name. argumentsArguments, if used, should follow immediately after options or com-
mand name.DESCRIPTION
jjrruunnssccrriipptt is a command line script shell. jrunscript supports both an
interactive (read-eval-print) mode and a batch (-ff option) mode of
script execution. This is a scripting language independent shell. Bydefault, JavaScript is the language used, but the -ll option can be used
to specify a different language. Through Java to scripting languagecommunication, jrunscript supports "exploratory programming" style.
NNOOTTEE:: This tool is eexxppeerriimmeennttaall and may nnoott be available in future ver-
sions of the JDK. OOPPTTIIOONNSS-ccllaassssppaatthh path
Specify where to find the user's .class files that are accessed by the script.-ccpp path
This is a synonym for -ccllaassssppaatthh path
-DDname==value
Set a Java system property.-JJflag
Pass flag directly to the Java virtual machine on which jrunscript
is run.-ll language
Use the specified scripting language. By default, JavaScript is used. Note that to use other scripting languages, you also need tospecify the corresponding script engine's jar file using -ccpp or
-ccllaassssppaatthh option.
-ee script
Evaluate the given script. This option can be used to run "one liner" scripts specified completely on the command line.-eennccooddiinngg encoding
Specify the character encoding used while reading script files.-ff script-file
Evaluate the given script file (batch mode).-ff -
Read and evaluate a script from standard input (interactive mode).-hheellpp
Output help message and exit.-??
Output help message and exit.If [arguments...] are present and if no -ee or -ff option is used, then
the first argument is the script file and the rest of the arguments, ifany, are passed as script arguments. If [arguments..] and -ee or -ff
option are used, then all [arguments..] are passed as script arguments.If [arguments..], -ee and -ff are missing, interactive mode is used.
Script arguments are available to a script in an engine variable named "arguments" of type String array. EEXXAAMMPPLLEESS EExxeeccuuttiinngg iinnlliinnee ssccrriippttssjjrruunnssccrriipptt -ee ""pprriinntt((''hheelllloo wwoorrlldd''))""
jjrruunnssccrriipptt -ee ""ccaatt((''hhttttpp::////jjaavvaa..ssuunn..ccoomm''))""
UUssee ssppeecciiffiieedd llaanngguuaaggee aanndd eevvaalluuaattee ggiivveenn ssccrriipptt ffiilleejjrruunnssccrriipptt -ll jjss -ff tteesstt..jjss
IInntteerraaccttiivvee mmooddee jjrruunnssccrriipptt jjss>>pprriinntt((''hheelllloo wwoorrlldd''));; hheelllloo wwoorrlldd jjss>>3344 ++ 5555 8899 jjss>> tthhrreeaadd((ffuunnccttiioonn(()) {{ pprriinntt((''hheelllloo wwoorrlldd''));; }} hheelllloo wwoorrlldd jjss>> RRuunn ssccrriipptt ffiillee wwiitthh ssccrriipptt aarrgguummeennttss jjrruunnssccrriipptt tteesstt..jjss aarrgg11 aarrgg22 aarrgg33 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.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)