Last active
November 7, 2015 05:19
-
-
Save nkonev/0d22f870a1a2aea18f2c to your computer and use it in GitHub Desktop.
Запуск процесса из groovysh
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
| // http://groovy.codehaus.org/Process+Management | |
| groovysh --terminal=none | |
| ["ping.exe", "first with space", "second"].execute().in.text | |
| println "ping".execute().text | |
| p = "ping".execute() | |
| println p.in.text | |
| println p.err.text | |
| // Скобки обязательны | |
| println p.exitValue() | |
| pr = "cmd /c dir".execute() | |
| pr.text |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
def p = "git tag".execute(Collections.emptyList(), new File("/var/lib/jenkins/workspace/run-tests-no-projects-update-2"))
p.waitFor()
def str = p.in.text // p.err.text
Arrays.asList(str.split("\s+"))