UNIX diff Edit Script 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?"

Edit script report explanation

The edit script created by Merge is explained below below. The edit script describes the editing that must be performed to the first file to turn it into the second file. Sufficient information is contained within the report to enable the second file to be converted into the first file too.

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

Three lines (5 through 7) from the second file need to be inserted before line 5 in the first file.

6c9
< stream was a small green frog, basking in the
---
> stream was a small blue frog, basking in the

Line 6 in the first file corresponds to line 9 in the second file, and needs to be changed from its current content (the lines prefixed with < before the --- marker) to the new content (the lines prefixed with > after the --- marker).

9c12
< "Hello small green frog!", said Eustace. "What
---
> "Hello small blue frog!", said Eustace. "What

Line 9 in the first file corresponds to line 12 in the second file, and needs to be changed from its current content (the lines prefixed with < before the --- marker) to the new content (the lines prefixed with > after the --- marker).

11,14d14
<
< Froggy didn't answer, so Eustace trod on him
< and wandered off into the nearby forest to look
< for wild onions.

Lines 11 through 14 need to be removed from the first file.