It's just a little awkward for scripting. I'd suggest to change the
behavior of the arguments when in scripting mode, so that in scripting
mode only one script is read, and the others are args.
Cheers,
Cay
Le 12/10/2013 12:26, Jim Laskey (Oracle) a écrit :
In general all arguments prior to -- are for the jjs command (see -help) and
all the arguments on the script command line are just a continuation of the
shebang line. At one point it was possible to #!/usr/bin/jjs -- to get all the
script command line arguments as arguments, but this doesn't seem to work any
more, will check with the launcher team about this.
On 2013-10-12, at 12:28 AM, Cay Horstmann <[email protected]> wrote:
Hi, I am writing a chapter on Nashorn for "Java 8 for the Impatient", which
will eventually find its way into one of the Core Java tomes.
I am a bit baffled why one needs to supply -- when calling a script with
arguments. I mean, when I put a
#!/usr/bin/jjs
in a script, why can't I just run it as
myScript arg1 arg2 arg3
instead of
myScript -- arg1 arg2 arg3
I know I can solve this with a second script, but it seems a hassle. And is
this a new thing? The article
http://benjiweber.co.uk/blog/2013/01/27/javascript-shell-scripting-with-nashorn/
doesn't mention it.
Thanks,
Cay
--
Cay S. Horstmann | http://horstmann.com | mailto:[email protected]
--
Cay S. Horstmann | http://horstmann.com | mailto:[email protected]