Created
September 4, 2016 15:10
-
-
Save planetsizebrain/fc6307fc7f8e1fea7c6ffd342e9357ca to your computer and use it in GitHub Desktop.
A Liferay Groovy script that allows you to execute OS level commands and prints the output
This file contains hidden or 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
def sout = new StringBuilder(), serr = new StringBuilder() | |
def proc = 'apt-get --just-print upgrade'.execute() | |
proc.consumeProcessOutput(sout, serr) | |
proc.waitForOrKill(10000) | |
println "out>" | |
println "$sout" | |
println "err>" | |
println "$serr" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment