jjs

Writing a `jjs` shebanged script that accepts just arguments

偶尔善良 提交于 2019-12-12 00:36:15
问题 Supposedly jjs is the Java 8 version of nashorn, ready for shell-scripting. However when I write a file with execute permission as: #!/usr/bin/jjs arguments.forEach(function(v,i,a){print(v);}); Running it produces some not so ideal shell-scripting behavior: $./file.js $./file.js one two java.io.IOException: one is not a file $./file.js -- one two one two $./file.js file.js -- one two # what were they thinking one two one two $ So, I don't ever want this script I'm writing to allow for the