UNIX diff Unified Report Example

The two files compared are shown below.

First File Second File
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Eustace, a pointy-eared hippopotamus, was
scampering across a summer meadow one day
when he suddenly came across a stream.

Sitting on a rock in the middle of the
stream was a small green frog, basking in the
afternoon sunshine.

"Hello small green frog!", said Eustace. "What
are you doing there?"

Froggy didn't answer, so Eustace trod on him
and wandered off into the nearby forest to look
for wild onions.
Eustace, a pointy-eared hippopotamus, was
scampering across a summer meadow one day
when he suddenly came across a stream.

Eustace almost fell into the stream, but
skidded to a halt just in time.

Sitting on a rock in the middle of the
stream was a small blue frog, basking in the
afternoon sunshine.

"Hello small blue frog!", said Eustace. "What
are you doing there?"

The unified format report created by Merge will look like the one shown below. For this example, two lines of unchanged context were specified using the relevant report option.

Context-report Explanation
--- E:\temp\Eustace1.txt	Sat Apr 28 00:51:11 2001
+++ E:\temp\Eustace2.txt	Sat Apr 28 00:51:18 2001
The first two lines list the two files that were compared. The filenames are followed by a (local time) timestamp that shows their last-modified dates and times.
@@ -3,12 +3,11 @@
 when he suddenly came across a stream.
 
+Eustace almost fell into the stream, but
+skidded to a halt just in time.
+
 Sitting on a rock in the middle of the
-stream was a small green frog, basking in the
+stream was a small blue frog, basking in the
 afternoon sunshine.
 
-"Hello small green frog!", said Eustace. "What
+"Hello small blue frog!", said Eustace. "What
 are you doing there?"
-
-Froggy didn't answer, so Eustace trod on him
-and wandered off into the nearby forest to look
-for wild onions.
This block shows lines that would need to be removed from the first file to create the second, and vice versa. Lines that should be removed from the first file to create the second are prefixed with a hyphen. Lines that should be removed from the second file to create the first are prefixed with a plus sign. Unchanged context lines have no prefix.