开发者

shell command in groovy

开发者 https://www.devze.com 2023-01-04 19:18 出处:网络
How to run this command in groovy : /h开发者_如何学Goome/srinath/junk/sync.sh > /home/srinath/junk/copy.log

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

精彩评论

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

关注公众号