Search notes:

jrunscript

jrunscript is a command line script shell whose default language is JavaScript (or more specifically JSR-223).
Apparently, the jrunscript executable is found in a JDK under its bin directory.

Examples

jrunscript -e "print('Hello world: ' + (21 * 2))"
jrunscript -e "cat('http://renenyffenegger.ch/notes/development/languages/JavaScript/jrunscript/index')"
js> fileRegex = 'pdf$'
pdf$
js> find('.', fileRegex, function(fileName) { echo(fileName); })
...
...
...
var proc = java.lang.Runtime.getRuntime().exec("c:\\Program Files\\Mozilla Firefox\\firefox.exe http://www.renenyffenegger.ch")
proc.waitFor()

Passing parameters to scripts

The script (abc.js)
for (var i in arguments) {
  echo (arguments[i]);
}
jrunscript abc.js foo bar baz

See also

jjs, which is the recommended tool to invoke the Nashorn scripting engine.
The javax.script Java package.
JavaScript

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758192379, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/JavaScript/jrunscript/index(75): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78