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

jshell tool: not suitable for pipeline use

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 9, 10
    • 10
    • tools
    • 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

              rfield Robert Field (Inactive)
              jrose John Rose
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: