In fact, from Jenkins doc: returnStdout
If checked, standard output from the task is returned as the step value as a String, rather than being printed to the build log. (Standard error, if any, will still be printed to the log.) You will often want to call .trim() on the result to strip off a trailing newline. On Sunday, February 19, 2017 at 6:25:51 PM UTC+1, David Karr wrote: > > On Thu, Feb 16, 2017 at 8:23 AM, Geethalakshmi Ramachandran > <geethalakshmi...@gmail.com <javascript:>> wrote: > > A jenkins pipeline calls an API that returns metrics and prints it in > the console output with formatting. However, Jenkins pipeline prints > standard output for each command like below: How to disable this or turn it > off? > > If you want to control how or whether stdout is emitted from a "sh" > step, instead of calling it like this: > ---------- > sh "command line" > --------- > > Do: > ---- > sh returnStdout: true; script: "command line" > ---- > > I suppose you could set that to "false" also,but I've never done that. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a70604ff-d115-42cd-a953-bdd164e1a5d3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.