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

Nashorn shebang argument handling is broken

    XMLWordPrintable

Details

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

    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

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

                Dates

                  Created:
                  Updated:
                  Resolved: