Skip to content

Instantly share code, notes, and snippets.

@uilian
Created May 21, 2014 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uilian/8a58256b9a72be6dc042 to your computer and use it in GitHub Desktop.
Save uilian/8a58256b9a72be6dc042 to your computer and use it in GitHub Desktop.
Groovy - executar linha de comando
String commandLine= "java -version"
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = commandLine.execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForProcessOutput()
if (sout) log.info "$sout"
if (serr) log.info "$serr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment