Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8143642

Nashorn shebang argument handling is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u60, 9
    • core-libs

        Shebang arguments are not handled properly. A script like the following one will drop the user in the jjs REPL without being run:

        #!/usr/local/bin/jjs -scripting -- hello
        print(arguments)

        $ ./shebang.js world
        jjs>

        It is possible to at least have the script executed by inserting the name of the script file in the shebang line, but the arguments are not ordered properly:

        #!/usr/local/bin/jjs -scripting shebang.js -- hello
        print(arguments)

        $ ./shebang.js world
        hello,./shebang.js,world

              mhaupt Michael Haupt
              mhaupt Michael Haupt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: