开发者

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 )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜