Search
Calendar
July 2017
S M T W T F S
« Sep    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
Your widget title
Archives

PostHeaderIcon How to call external shell in Groovy?

Going on learning Groovy, I faced the following case: how to call an external shell (or MS-DOS) command from a Groovy script?

It is very easy. The following example show how to display the Subversion status of the current folder:

def proc = "svn st"
def sb = new StringBuffer()
proc.consumeProcessErrorStream(sb)

println proc.text + "\n" +  sb.toString()

Leave a Reply