jrunscript(1)
π jrunscript(1) β Scripting Tools, but make it group chat π
okay so bestie, this is the jrunscript(1) page from Scripting Tools. Buckle up, because it's experimental and unsupported β the manual said it, not me. π«Ά
πΈ NAME πΈ
jrunscript β runs a command-line script shell that supports interactive and batch modes. This command is experimental and unsupported. No cap, that's the official warning.
β¨ SYNOPSIS β¨
jrunscript [options] [arguments]
optionsβ the command-line options. See OPTIONS.argumentsβ arguments, when used, follow immediately afteroptionsor the command name. See ARGUMENTS.
π¦ DESCRIPTION π¦
The jrunscript command is a language-independent command-line script shell. It supports both an interactive (read-eval-print) mode and a batch (-f option) mode of script execution. By default, JavaScript is the language used, but the -l option can be used to specify a different language. By using Java to scripting language communication, the jrunscript command supports an exploratory programming style. Literally iconic. π
tiny heads-up: the DESCRIPTION says-l, and the OPTIONS list below spells it-I language. I'm not fixing the page, I'm just reporting the vibe. π
π OPTIONS π
-classpathpath β indicate where any class files are that the script needs to access.-cppath β same as-classpathpath(yes, that's exactly how the page writes it π).-Dname=value(aka-Dname) β sets a Java system property.-Jflagβ passes flag directly to the Java Virtual Machine where thejrunscriptcommand is running.-Ilanguage β 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-cpor-classpathoption. (The page writes this flag as-I language, and DESCRIPTION says-lβ both are here, iykyk.)-escript β evaluates the specified script. This option can be used to run one-line scripts that are specified completely on the command line.-encodingencoding β specifies the character encoding used to read script files.-fscript-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
argumentsare present and if no-eor-foption is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script. - If
argumentsand-eor the-foption are used, then all arguments are passed to the script. - If
arguments,-eand-fare missing, then interactive mode is used. - Script arguments are available to a script in an engine variable named
argumentsof typeStringarray.
π§ͺ EXAMPLES π§ͺ
EXECUTE INLINE SCRIPTS
jrunscript -e "print('hello world')"
jrunscript -e "cat('http://www.example.com')"
USE SPECIFIED LANGUAGE AND EVALUATE THE SCRIPT FILE
jrunscript -l js -f test.js
INTERACTIVE MODE
jrunscript
js> print('Hello World\n');
Hello World
js> 34 + 55
89.0
js> t = new java.lang.Thread(function() { print('Hello World\n'); })
Thread[Thread-0,5,main]
js> t.start()
js> Hello World
js>
RUN SCRIPT FILE WITH SCRIPT ARGUMENTS
The test.js file is the script file. The arg1, arg2 and arg3 arguments are passed to the script. The script can access these arguments with an arguments array.
jrunscript test.js arg1 arg2 arg3
π SEE ALSO π
If JavaScript is used, then before it evaluates a user defined script, the jrunscript 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/
okay that's the whole page, bestie π β it's from JDK 8, dated 21 November 2013, and the manual is jrunscript(1). mwah π
π¦ where this page comes from
- centos-stream 9: java-11-openjdk-devel-slowdebug 1:11.0.20.1.1-2.el9 Β· ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA
- Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms