用 shell script 進行集合計算
linux shell set --
sort a.file b.file b.file | uniq -u
-
sort a.file b.file | uniq
-
sort a.file b.file | uniq -d
How
有 a.file
和 b.file
兩個檔案,裡面各自含以不重複的行構成的資料。
可利用下列方法各自求出兩個檔案內容的交集,聯集與差集。
sort a.file b.file b.file | uniq -u
sort a.file b.file | uniq
sort a.file b.file | uniq -d