Created
October 10, 2010 13:06
-
-
Save masanobuimai/619231 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
// g100pon #76 外部コマンドの起動と出力の取得等 | |
def COMMAND = "ls -l ." | |
// def COMMAND = "cmd /c dir" // Windowsだったらこう? | |
// 外部コマンドの実行 | |
def p = COMMAND.execute() | |
p.waitFor() // 終了まで待機 | |
println p.exitValue() // 終了コード | |
// 外部コマンドの出力を取得 | |
println p.text // 標準出力(または p.in.text) | |
println p.err.text // 標準エラー出力 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment