Created
May 18, 2016 22:25
-
-
Save adampats/e682c61fb425a200453607a663980af4 to your computer and use it in GitHub Desktop.
Jenkins groovy script to execute shell command
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 cmd = 'hostname' | |
def sout = new StringBuffer(), serr = new StringBuffer() | |
def proc = cmd.execute() | |
proc.consumeProcessOutput(sout, serr) | |
proc.waitForOrKill(1000) | |
println sout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. But the below command is not working.
Also wildcard is not working. is there any solution?