DIFF3(1) UNIX Programmer's Manual DIFF3(1)
diff3 - 3-way differential file comparison
S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
d
\bdi
\bif
\bff
\bf3
\b3 [ -
\b-e
\bex
\bxE
\bEX
\bX3
\b3 ] file1 file2 file3
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
_
\bD_
\bi_
\bf_
\bf_
\b3 compares three versions of a file, and publishes
disagreeing ranges of text flagged with these codes:
==== all three files differ
====1 _
\bf_
\bi_
\bl_
\be_
\b1 is different
====2 _
\bf_
\bi_
\bl_
\be_
\b2 is different
====3 _
\bf_
\bi_
\bl_
\be_
\b3 is different
The type of change suffered in converting a given range of a
given file to some other is indicated in one of these ways:
_
\bf :
\b: _
\bn_
\b1 a
\ba Text is to be appended after line number _
\bn_
\b1
in file _
\bf, where _
\bf = 1, 2, or 3.
_
\bf :
\b: _
\bn_
\b1 ,
\b, _
\bn_
\b2 c
\bc Text is to be changed in the range line _
\bn_
\b1
to line _
\bn_
\b2. If _
\bn_
\b1 = _
\bn_
\b2, the range may be
The original contents of the range follows immediately after
a c
\bc indication. When the contents of two files are identi-
cal, the contents of the lower-numbered file is suppressed.
Under the -
\b-e
\be option, _
\bd_
\bi_
\bf_
\bf_
\b3 publishes a script for the editor
_
\be_
\bd that will incorporate into _
\bf_
\bi_
\bl_
\be_
\b1 all changes between
_
\bf_
\bi_
\bl_
\be_
\b2 and _
\bf_
\bi_
\bl_
\be_
\b3, _
\bi._
\be. the changes that normally would be
flagged ==== and ====3. Option -
\b-x
\bx (-
\b-3
\b3) produces a script to
incorporate only changes flagged ==== (====3). The follow-
ing command will apply the resulting script to `file1'.
(cat script; echo '1,$p') | ed - file1
The -
\b-E
\bE and -
\b-X
\bX are similar to -
\b-e
\be and -
\b-x
\bx, respectively, but
treat overlapping changes (i.e., changes that would be
flagged with ==== in the normal listing) differently. The
overlapping lines from both files will be inserted by the
edit script, bracketed by "<<<<<<" and ">>>>>>" lines.
For example, suppose lines 7-8 are changed in both file1 and
file2. Applying the edit script generated by the command
"diff3 -E file1 file2 file3"
to file1 results in the file:
Printed 7/9/88 August 20, 1985 1
DIFF3(1) UNIX Programmer's Manual DIFF3(1)
The -
\b-E
\bE option is used by RCS _
\bm_
\be_
\br_
\bg_
\be(1) to insure that over-
lapping changes in the merged files are preserved and
brought to someone's attention.
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
Text lines that consist of a single `.' will defeat -
\b-e
\be.
\b.
Printed 7/9/88 August 20, 1985 2