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

jshell tool: not suitable for pipeline use

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b31

      Description

      The following shell command should produce a single line of output:

      $ (echo '1+1'; echo 'System.out.println("ans = "+$1)') | jshell -s | cat

      Instead it prints additional prompts and duplicates of the input snippets.

      That's not really a true "silent mode", in the sense of "make -s", "read -s", etc.

      This is surprising enough to be a bug. It also prevents jshell from being used (like other shells) in pipelines, networking scripts, etc.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rfield Robert Field
                Reporter:
                jrose John Rose
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: