Execute bash (cmd, csh etc.) command

By neokrates, written on April 27, 2010

groovy   snippet

  • Join date: 11-30-99
  • Posts: 224
View Counter:
  • 84 views
Rate it
Ad
Poll
  • Which frameworks do you use to test your web frontend?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
1
2
3
4
5
6
7
def anyCommand = "date"
println "command = ($anyCommand)"
def proc = anyCommand.execute();
proc.waitFor();
println "return code: ${ proc.exitValue()}"
println "stderr: ${proc.err.text}"
println "stdout: ${proc.in.text}"
Be Sociable, Share!
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: 0 (from 2 votes)
1 votes 'YES'  1 votes 'NO'
TAGS
No tags for this post.
RELATED
Pages
Posts
SOCIAL
Be Sociable, Share!

Leave a Reply