0
文件,我有這樣兩個文件,yolo.txt
和bar.txt
:的bash重定向到沒有工作
yolo.txt:
a
b
c
跳回到bar.txt:
c
我有以下命令,它可以得到我想要的輸出:
$ cat yolo.txt bar.txt | sort | uniq -u | sponge
a
b
但是當我添加重定向(>
)語句,輸出的變化:
$ cat yolo.txt bar.txt | sort | uniq -u | sponge > yolo.txt && cat yolo.txt
c
我預想的輸出保持不變,我很困惑。請幫幫我。
你知道海綿,但你不知道爲什麼它是必要的?這是怎麼來的? –