【发布时间】:2022-11-17 18:14:12
【问题描述】:
我目前有两个文件:anotherFile 和myFile,它们正在合并到一个result 文件中,该文件已排序。所有这一切都是 3 个步骤,但是我希望能够做到所谓的“单线”
目前
#(script which creates 'anotherFile')
anotherFile > result
cat ./myFile | cut -f 1,2 >> result
sort -o result{,}
我希望能够“单行”这个,所以我不必参考 result 文件 3 次!
cat ./myFile | cut -f 1,2 | xargs -I sort -m anotherFile {} > finalFile
我知道上面的内容不起作用,因为 {} 不是现有文件。
【问题讨论】:
标签: bash