Search
Calendar
November 2017
S M T W T F S
« Sep    
 1234
567891011
12131415161718
19202122232425
2627282930  
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