你好
我想要在Groovy程序中执行类似于cat /path/to/file1 /path/to/file2 > /path/to/file3的命令。我尝试了"cat /path/to/file1 /path/to/file2 > /path/to/file3".execute(),但是这并没有起作用。
经过一些搜索,我了解到了sh -c的使用方法。因此,我尝试了"sh -c cat /path/to/file1 /path/to/file2 > /path/to/file3".execute(),但还是没有成功。
你有什么建议吗?