COHERENT manpages
This page displays the COHERENT manpage for diff3 [Summarize differences among three files].
List of available manpages
Index
diff3 -- Command
Summarize differences among three files
diff3 [-ex3] file1 file2 file3
diff3 summarizes the differences among three text files. Each difference
encountered is headed by one of the following separators, which categorizes
how many of the three input files differ in a given range. The headers are
as follows
==== All of the files are different.
====n Only the nth file differs, where n may be 1, 2, or 3.
For each set of changes marked as above, the actual change is indicated for
each file using a notation similar to commands to ed. For each filen the
following is printed:
n: la Text is to be appended after line l in filen.
n: l,mc
The text from line l to line m is to be changed for filen. The
original text from filen follows this line. If this text is
identical for two of the files, only the latter (higher numbered)
of the two is printed.
Options are available to print a script of commands to ed. Option -e tells
diff3 to generate a script that makes all changes between file2 and file3
to file1. This script is based upon all changes flagged with the separators
==== or ====3, as described above.
The option -x prints only those changes where all three files differ, i.e.,
those flagged with ====.
The option -3 requests only those changes where file3 differs.
Example
The following command sequence produces a script, applies it to file1, and
sends the result to the standard output.
(diff3 -e file1 file2 file3; echo '1,$p') | ed - file1
Files
/tmp/d3*
/usr/lib/diff3
See Also
commands,
diff,
ed
Diagnostics
An exit status of zero indicates all three files were identical, one
indicates differences, and two indicates some other failure.