summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/diff3.1
blob: 46b1b7ae2ac884894b6d2e48530390327681ff66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
'\" te
.\" Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
.\"  Copyright 1989 AT&T  Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DIFF3 1 "Oct 22, 2014"
.SH NAME
diff3 \- 3-way differential file comparison
.SH SYNOPSIS
.LP
.nf
\fBdiff3\fR [\fB-exEX3\fR] \fIfilename1\fR \fIfilename2\fR \fIfilename3\fR
.fi

.SH DESCRIPTION
.sp
.LP
\fBdiff3\fR compares three versions of a file. It publishes disagreeing ranges
of text flagged with the following codes:
.sp
.ne 2
.na
\fB\fB====\fR\fR
.ad
.RS 9n
all three files differ
.RE

.sp
.ne 2
.na
\fB\fB====1\fR\fR
.ad
.RS 9n
\fIfilename1\fR is different
.RE

.sp
.ne 2
.na
\fB\fB====2\fR\fR
.ad
.RS 9n
\fIfilename2\fR is different
.RE

.sp
.ne 2
.na
\fB\fB====3\fR\fR
.ad
.RS 9n
\fIfilename3\fR is different
.RE

.sp
.LP
The type of change suffered in converting a given range of a given file to some
other is indicated in one of the following ways:
.sp
.ne 2
.na
\fB\fIf\fR\fB : \fR\fIn1\fR\fB a\fR\fR
.ad
.RS 17n
Text is to be appended after line number \fIn1\fR in file \fIf\fR, where
\fIf\fR = 1, 2, or 3.
.RE

.sp
.ne 2
.na
\fB\fIf\fR\fB : \fR\fIn1\fR\fB , \fR\fIn2\fR\fB c\fR\fR
.ad
.RS 17n
Text is to be changed in the range line \fIn1\fR to line \fIn2\fR. If \fIn1\fR
= \fIn\fR2, the range can be abbreviated to \fIn1\fR.
.RE

.sp
.LP
The original contents of the range follows immediately after a \fBc\fR
indication. When the contents of two files are identical, the contents of the
lower-numbered file is suppressed.
.sp
.LP
The following command applies the resulting script to \fIfilename1\fR.
.sp
.in +2
.nf
\fB(cat script; echo a\'1,$pa\') | ed \(mi \fR\fIfilename1\fR
.fi
.in -2
.sp

.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-e\fR \fR
.ad
.RS 7n
Produce a script for the \fBed\fR(1) editor that incorporates into
\fIfilename1\fR all changes between \fIfilename2\fR and \fIfilename3\fR (that
is, the changes that normally would be flagged \fB====\fR and \fB====3\fR).
.sp
Text lines that consist of a single dot (\fB\&.\fR defeat the \fB-e\fR option.
.RE

.sp
.ne 2
.na
\fB\fB-E\fR \fR
.ad
.RS 7n
Produce a script that incorporates all changes between \fIfilename2\fR and
\fIfilename3\fR, but treat overlapping changes (that is, changes that would be
flagged with \fB====\fR in the normal listing) differently. The overlapping
lines from both files are inserted by the edit script, bracketed by
\fB<<<<<<\fR and \fB>>>>>>\fR lines.
.RE

.sp
.ne 2
.na
\fB\fB-x\fR \fR
.ad
.RS 7n
Produce a script to incorporate only changes flagged \fB====\fR.
.RE

.sp
.ne 2
.na
\fB\fB-X\fR \fR
.ad
.RS 7n
Produce a script that incorporates only changes flagged \fB====\fR, but treat
these changes in the manner of the \fB-E\fR option.
.RE

.sp
.ne 2
.na
\fB\fB-3\fR \fR
.ad
.RS 7n
Produce a script to incorporate only changes flagged \fB====3\fR.
.RE

.SH USAGE
.sp
.LP
See \fBlargefile\fR(5) for the description of the behavior of \fBdiff3\fR when
encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
.SH FILES
.sp
.ne 2
.na
\fB\fB/tmp/d3*\fR \fR
.ad
.RS 23n

.RE

.sp
.ne 2
.na
\fB\fB/usr/lib/diff3prog\fR \fR
.ad
.RS 23n

.RE

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR \fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 6n
An error occurred. A difference was found or there was a fatal error.
.RE

.sp
.ne 2
.na
\fB\fB>1\fR\fR
.ad
.RS 6n
A fatal error occurred.
.RE

.sp
.LP
Return values do not work the same as \fBdiff\fR(1) or other vendor's versions
of \fBdiff3\fR.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
CSI	Enabled
.TE

.SH SEE ALSO
.sp
.LP
\fBdiff\fR(1), \fBattributes\fR(5), \fBlargefile\fR(5)
.SH NOTES
.sp
.LP
Files longer than 64 Kbytes do not work.