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