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

jshell tool: not suitable for pipeline use

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • 9, 10
    • tools
    • b31

      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.

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

              Created:
              Updated:
              Resolved: