I'm trying to get diff
to only output changed lines, not added or deleted files.
So if file 1 contains:
hello 1
my 2
name 3
and file 2 contains:
hello 2
my 2
earth
I would get output similar to:
< hello 1
> hello 2
I've searched both on Google and Stack Overflow, and found a perl script at Stack Overflow, but that doesn't output anything.
Any way this can easily be done?
According to your example, I guess your question is "get diff to only output changed lines, not added or deleted lines." (not files). Right ?
If so, I think it's difficult to distinguish "added or deleted lines" from "changed lines".
e.g.
vs
The differences of the 3rd line, is a "changed" or a "added or deleted"