1DIFF3(1) General Commands Manual DIFF3(1)
2
3
4
6 diff3 - 3-way differential file comparison
7
9 diff3 [ -exEX3 ] file1 file2 file3
10
12 Diff3 compares three versions of a file, and publishes disagreeing
13 ranges of text flagged with these codes:
14
15 ==== all three files differ
16
17 ====1 file1 is different
18
19 ====2 file2 is different
20
21 ====3 file3 is different
22
23 The type of change suffered in converting a given range of a given file
24 to some other is indicated in one of these ways:
25
26 f : n1 a Text is to be appended after line number n1 in file f,
27 where f = 1, 2, or 3.
28
29 f : n1 , n2 c Text is to be changed in the range line n1 to line n2.
30 If n1 = n2, the range may be abbreviated to n1.
31
32 The original contents of the range follows immediately after a c indi‐
33 cation. When the contents of two files are identical, the contents of
34 the lower-numbered file is suppressed.
35
36 Under the -e option, diff3 publishes a script for the editor ed that
37 will incorporate into file1 all changes between file2 and file3, i.e.
38 the changes that normally would be flagged ==== and ====3. Option -x
39 (-3) produces a script to incorporate only changes flagged ====
40 (====3). The following command will apply the resulting script to
41 `file1'.
42
43 (cat script; echo ´1,$p´) ⎪ ed - file1
44
45 The -E and -X are similar to -e and -x, respectively, but treat over‐
46 lapping changes (i.e., changes that would be flagged with ==== in the
47 normal listing) differently. The overlapping lines from both files
48 will be inserted by the edit script, bracketed by "<<<<<<" and ">>>>>>"
49 lines.
50
51 For example, suppose lines 7-8 are changed in both file1 and file2.
52 Applying the edit script generated by the command
53 "diff3 -E file1 file2 file3"
54 to file1 results in the file:
55
56 lines 1-6
57 of file1
58 <<<<<<< file1
59 lines 7-8
60 of file1
61 =======
62 lines 7-8
63 of file3
64 >>>>>>> file3
65 rest of file1
66
67 The -E option is used by RCS merge(1) to insure that overlapping
68 changes in the merged files are preserved and brought to someone's
69 attention.
70
72 /tmp/d3?????
73 /usr/libexec/diff3
74
76 diff(1)
77
79 Text lines that consist of a single `.' will defeat -e.
80
81
82
837th Edition October 21, 1996 DIFF3(1)