コマンド出力の差分に対してとある処理をしたかったので汎用部分をまとめてみた
入力A
$ cat A
a
b
c
a
b
c
入力B
$ cat B
A
b
C
A
b
C
積集合
$ join <(cat A|sort -u) <(cat B|sort -u)
b
差集合
$ cat <(cat A|sort -u) <(join <(cat A|sort -u) <(cat B|sort -u) ) | sort | uniq -u
a
c
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
2219