Last output line of sh not printed when not terminated with newline

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Reproducer:

      node() {
        sh "printf 'one\ntwo\nthree'"
      }
      

      prints just:

      one
      two
      

      The workaround is to append EOL at the end of the sh output but it can be pretty confusing before diagnosed.

      —

      Printing curl response this way has caused only DOCTYPE line to be printed as the rest of Jenkins markup served was on the last single line and thus not shown at all.

            Assignee:
            Unassigned
            Reporter:
            Oliver Gondža
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: