[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
diff -c0 reports change instead of deleted
From: |
Allen Tupker |
Subject: |
diff -c0 reports change instead of deleted |
Date: |
Sat, 10 May 2008 13:11:43 -0500 |
Binary package hint: diff
Using Ubuntu 7.04
version reported with apt-cache policy diff
diff:
Installed: 2.8.1-11ubuntu4
When the command diff -c0 A B is used to compare the two separate text
files (with contents listed below), shouldn't diff report the test2 line
as "deleted" by preceding it with a minus sign in the diff output?
Instead diff reports the test2 line as a changed line by preceding it
with an exclamation point in the diff output. This behavior is triggered
by having the line "This is a test3" contain a change in file B. Diff
functions as expected if the test3 line is the same in file A and B.
I have also seen this behavior in a recent but unknown release of
Redhat.
file A
This is a test1
This is a test2
This is a test3
This is a test4
file B
This is a test1
This is a test33
This is a test4
diff -c0 A B
*** A 2008-05-08 22:46:27.000000000 -0500
--- B 2008-05-08 22:46:55.000000000 -0500
***************
*** 2,3 ****
! This is a test2
! This is a test3
--- 2 ----
! This is a test33
- diff -c0 reports change instead of deleted,
Allen Tupker <=