shell command in groovy
How to run this command in groovy :
/h开发者_如何学Goome/srinath/junk/sync.sh > /home/srinath/junk/copy.log
This is working when tried on terminal . but fails when used execute in groovy
Could any one please help me on this .
thanks in advance
sri..Shell based redirection and piping doesn't work from inside the JVM without a bit of data handling
For this example, you should be able to do:
new File( '/home/srinath/junk/copy.log' ).write( '/home/srinath/junk/sync.sh'.execute().text )
精彩评论