UNIX diff Context Report Example
This report example compares these two files:
1 Eustace, a pointy-eared hippopotamus, was
2 scampering across a summer meadow one day
3 when he suddenly came across a stream.
4
5 Sitting on a rock in the middle of the
6 stream was a small green frog, basking in the
7 afternoon sunshine.
8
9 "Hello small green frog!", said Eustace. "What
10 are you doing there?"
11
12 Froggy didn't answer, so Eustace trod on him
13 and wandered off into the nearby forest to look
14 for wild onions.
1 Eustace, a pointy-eared hippopotamus, was
2 scampering across a summer meadow one day
3 when he suddenly came across a stream.
4
5 Eustace almost fell into the stream, but
6 skidded to a halt just in time.
7
8 Sitting on a rock in the middle of the
9 stream was a small blue frog, basking in the
10 afternoon sunshine.
11
12 "Hello small blue frog!", said Eustace. "What
13 are you doing there?"
Context report explanation
The context-format report created by Merge is explained below. For this example, two lines of unchanged context were specified.
*** 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. Throughout the report, asterisks represent the first file and hyphens represent the second file. The filenames are followed by a (local time) timestamp that shows their last-modified dates and times.
***************
*** 3,14 ****
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.
This block shows changed and removed lines in the first file. Changes are surrounded by unchanged context lines. The numbers at the start of the block show that the block starts at line 3 in the first file and ends at line 14.
If a change and its surrounding context lines overlap another change and its surrounding context lines, the changes are combined into one block (as in this example).
Changed lines are prefixed with an exclamation mark. Removed lines are prefixed with a hyphen. Unchanged lines have no prefix character.
--- 3,13 ----
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?"
This block shows changed and inserted lines in the second file. Changed lines are prefixed with an exclamation mark. Inserted lines are prefixed with a plus sign. Unchanged lines have no prefix character.