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

Nashorn shebang argument handling is broken

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u60, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:

      Backports

        Description

        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

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: