Quote:
I want to end up with the *entire* record from the first dump that was a duplicate, not just the keys. So in my example, I wanted:
Code:
green circle small
red circle large
|
Is this what you want?
Code:
$ cat test1.txt
green circle small
green square large
green triangle medium
red circle large
red triangle small
yellow square large
yellow triangle medium
$ cat test2.txt
purple circle small
purple triangle small
green circle medium
yellow rectangle large
yellow trapezoid small
red circle medium
pink circle large
$ cat test1.txt test2.txt | sort -sk 1,2 | awk '{printf "%100s%100s%100s\n", $1, $2, $3}' | uniq -d -w 200 | awk '{printf "%s %s %s\n", $1 ,$2, $3}'
green circle small
red circle large
Yves.