For example:
file1.txt:
I need to buy apples.
I need to run the laundry.
I need to wash the dog.
I need to get the car detailed.
file2.txt
I need to buy apples.
I need to run the laundry.
I need to wash the car.
I need to get the car detailed.
file3.txt
I need to wash the car.
If I do diff file1.txt file2.txt
,
the statements present in file3.txt should be ignored by diff command if it is present in file2.txt. So, in this case, there should be no difference.
Using ignore flag (diff -I "$line"
) won't help since it finds pattern in both files.
How can I do this?
if
condition so I thought first filter out the line from file2 and corresponding lines from file1 somehow and count the lines ofdiff
output.