Q
常规bash命令
1
A
回答
0
的>
是一个shell运营商和应该是一个shell中运行。试试这个,它可能工作:
sh -c 'bash copy.txt > copy.log'
+0
嗨桑德兰,我想是这样,但没有运气。我没有找到我的文件夹中的copy.log。 DEF测试= “SH -c '的bash /home/srinath/Desktop/copy.txt> copy.log'” test.execute()。谢谢 – srinath 2010-05-26 11:33:02
0
在bash你usally做
cat copy.txt > copy.log
除非你认为copy.txt是一个shell脚本。 但我想没有按照你给的扩展。
2
我假定你正在试图复制文件copy.txt在同一个文件夹中copy.log。有几种'纯粹'的Groovy方法可以做到这一点,但是你可以在Linux上使用本地调用来做到这一点,如下所示。
例子: ['/bin/sh', '-c', 'cat copy.txt > copy.log'].execute().consumeProcessOutput(System.out, System.err)
Groovy的方式: new File('copy.log') << new File('copy.txt').text
相关问题
- 1. boot2docker bash命令行非常慢
- 2. &bash命令后
- 3. bash -x命令
- 4. unix bash命令
- 5. Bash expr命令
- 6. gradle这个:常规命令行 - grep的
- 7. Windows命令行管串到常规
- 8. 解析非常规命令输出
- 9. Visual Studio命令提示符与常规命令提示符?
- 10. bash命令XOR^anothercommand
- 11. bash命令参数
- 12. Bash Shell - The:命令
- 13. 编辑bash命令?
- 14. bash命令可变
- 15. 遍历bash命令
- 16. Linux Bash goto命令?
- 17. 运行bash命令
- 18. 由bash命令行
- 19. \!在Bash命令中
- 20. 系统命令bash
- 21. 嵌入bash命令
- 22. $“\ r” - 命令在bash
- 23. bash命令输出
- 24. bash for inline命令
- 25. 命令不认识bash命令别名
- 26. Postgresql规则命令
- 27. Elasticsearch常规令牌
- 28. 包装bash查找命令
- 29. 解释bash命令$ {PATH}:
- 30. 结合R + awk + bash命令
这可能会帮助很多,如果你是一个更具体一点什么你正在尝试做的,哪些是你所问上受审所以。 – xlson 2010-06-04 07:41:03