Skip to content

Instantly share code, notes, and snippets.

@pedroxs
Created August 29, 2017 18:39
Show Gist options
  • Save pedroxs/8f5bd45c6e9d6811dd6f882f19eea854 to your computer and use it in GitHub Desktop.
Save pedroxs/8f5bd45c6e9d6811dd6f882f19eea854 to your computer and use it in GitHub Desktop.
Running shell commands with error redirection on Jenkins Script Console
def cmd = "ls -l"
println new ProcessBuilder('sh','-c',cmd).redirectErrorStream(true).start().text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment