- publishing free software manuals
Comparing and Merging Files with GNU diff and patch
by David MacKenzie, Paul Eggert, and Richard Stallman
Paperback (6"x9"), 120 pages
ISBN 0954161750
RRP £12.95 ($19.95)

"Well packaged... the quality of information is excellent" --- Linux User and Developer Magazine (Issue 36, Feb 2004) Get a printed copy>>>

2.5.3 RCS Scripts

The RCS output format is designed specifically for use by the Revision Control System, which is a set of free programs used for organizing different versions and systems of files. Use the -n or --rcs option to select this output format. It is like the forward ed format (see section 2.5.2 Forward ed Scripts), but it can represent arbitrary changes to the contents of a file because it avoids the forward ed format's problems with lines consisting of a single period and with incomplete lines. Instead of ending text sections with a line consisting of a single period, each command specifies the number of lines it affects; a combination of the ‘a’ and ‘d’ commands are used instead of ‘c’. Also, if the second file ends in a changed incomplete line, then the output also ends in an incomplete line.

Here is the output of ‘diff -n lao tzu’ (see section 2.1 Two Sample Input Files, for the complete contents of the two files):

d1 2
d4 1
a4 2
The named is the mother of all things.

a11 3
They both may be called deep and profound.
Deeper and more profound,
The door of all subtleties!
ISBN 0954161750Comparing and Merging Files with GNU diff and patchSee the print edition