jrunscript(1)

πŸ“¦ version 1.8.0.504.b01, in centos-stream 9

πŸ’… 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 after options or 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 πŸ’…

  • -classpath path β€” indicate where any class files are that the script needs to access.
  • -cp path β€” 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 the jrunscript 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 -cp or -classpath option. (The page writes this flag as -I language, and DESCRIPTION says -l β€” both are here, iykyk.)
  • -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 -e or -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 -e or the -f option are used, then all arguments are passed to the script.
  • If arguments, -e and -f are missing, then interactive mode is used.
  • Script arguments are available to a script in an engine variable named arguments of type String array.

πŸ§ͺ 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-1.8.0-openjdk-devel-fastdebug 1:1.8.0.504.b01-2.1.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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms