Created
May 21, 2014 17:13
-
-
Save uilian/8a58256b9a72be6dc042 to your computer and use it in GitHub Desktop.
Groovy - executar linha de comando
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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