Result the usual lines (resemblances) of 2 message submits (the reverse of diff)?
Diff is a wonderful device to present the adjustments in between 2 documents. Yet just how to present the resemblances of 2 message documents (while overlooking the distinctions)?
I.e. example input:
a: Foo Bar X Hello World 42 b: Foo Baz Hello World 23
Quasi result (something similar to this) :
@@ 2,3 =Hello World
Simply arranging both documents and also making use of comm is not nearly enough, due to the fact that because instance the line details is shed.
How around making use of diff, despite the fact that you do not desire a diff? Attempt this :
diff --unchanged-group-format='@@ %dn,%df %<' --old-group-format='' --new-group-format='' \ --changed-group-format='' a.txt b.txt
Below is what I get with your example information :
$ cat a.txt Foo Bar X Hello World 42 $ cat b.txt Foo Baz Hello World 23 $ diff --unchanged-group-format='@@ %dn,%df %<' --old-group-format='' --new-group-format='' \ --changed-group-format='' a.txt b.txt @@ 2,3 Hello World
I do not assume there is a solitary command that does what you desire it to do. You can attempt to incorporate the result of
grep, however. If your message documents have none of the personalities
>, the adhering to offers you rather valuable result :
$ diff --side-by-side a b | grep -n -v "[|<>]" 3:Hello Hello 4:World World