Created
February 24, 2017 03:20
-
-
Save h1romas4/acc883f2a1b6057e92246f8156ad7cf1 to your computer and use it in GitHub Desktop.
コマンドを実行し、標準・エラー出力を行いながらリターンコードを取得
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
def builder = new ProcessBuilder("ls -laF".split("[\\s]+")) | |
def process = builder.redirectErrorStream(true).start() | |
process.inputStream.eachLine { println it } | |
process.waitFor() | |
println process.exitValue() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment