Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save thomaschaplin/b06fd3d0df5d3d790c7baafc3713ff28 to your computer and use it in GitHub Desktop.

Select an option

Save thomaschaplin/b06fd3d0df5d3d790c7baafc3713ff28 to your computer and use it in GitHub Desktop.
def sout = new StringBuilder(), serr = new StringBuilder()
def proc = "ls /var/jenkins_home/jobs".execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(30000)
println "out> $sout\nerr> $serr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment