1 '\" te
   2 .\"  Copyright 1989 AT&T  Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved
   3 .\" 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.
   4 .\" 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.
   5 .\" 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]
   6 .TH DIFF3 1 "Nov 7, 2005"
   7 .SH NAME
   8 diff3 \- 3-way differential file comparison
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fBdiff3\fR [\fB-exEX3\fR] \fIfilename1\fR \fIfilename2\fR \fIfilename3\fR
  13 .fi
  14 
  15 .SH DESCRIPTION
  16 .sp
  17 .LP
  18 \fBdiff3\fR compares three versions of a file. It publishes disagreeing ranges
  19 of text flagged with the following codes:
  20 .sp
  21 .ne 2
  22 .na
  23 \fB\fB====\fR\fR
  24 .ad
  25 .RS 9n
  26 all three files differ
  27 .RE
  28 
  29 .sp
  30 .ne 2
  31 .na
  32 \fB\fB====1\fR\fR
  33 .ad
  34 .RS 9n
  35 \fIfilename1\fR is different
  36 .RE
  37 
  38 .sp
  39 .ne 2
  40 .na
  41 \fB\fB====2\fR\fR
  42 .ad
  43 .RS 9n
  44 \fIfilename2\fR is different
  45 .RE
  46 
  47 .sp
  48 .ne 2
  49 .na
  50 \fB\fB====3\fR\fR
  51 .ad
  52 .RS 9n
  53 \fIfilename3\fR is different
  54 .RE
  55 
  56 .sp
  57 .LP
  58 The type of change suffered in converting a given range of a given file to some
  59 other is indicated in one of the following ways:
  60 .sp
  61 .ne 2
  62 .na
  63 \fB\fIf\fR\fB : \fR\fIn1\fR\fB a\fR\fR
  64 .ad
  65 .RS 17n
  66 Text is to be appended after line number \fIn1\fR in file \fIf\fR, where
  67 \fIf\fR = 1, 2, or 3.
  68 .RE
  69 
  70 .sp
  71 .ne 2
  72 .na
  73 \fB\fIf\fR\fB : \fR\fIn1\fR\fB , \fR\fIn2\fR\fB c\fR\fR
  74 .ad
  75 .RS 17n
  76 Text is to be changed in the range line \fIn1\fR to line \fIn2\fR. If \fIn1\fR
  77 = \fIn\fR2, the range can be abbreviated to \fIn1\fR.
  78 .RE
  79 
  80 .sp
  81 .LP
  82 The original contents of the range follows immediately after a \fBc\fR
  83 indication. When the contents of two files are identical, the contents of the
  84 lower-numbered file is suppressed.
  85 .sp
  86 .LP
  87 The following command applies the resulting script to \fIfilename1\fR.
  88 .sp
  89 .in +2
  90 .nf
  91 \fB(cat script; echo a\'1,$pa\') | ed \(mi \fR\fIfilename1\fR
  92 .fi
  93 .in -2
  94 .sp
  95 
  96 .SH OPTIONS
  97 .sp
  98 .LP
  99 The following options are supported:
 100 .sp
 101 .ne 2
 102 .na
 103 \fB\fB-e\fR \fR
 104 .ad
 105 .RS 7n
 106 Produce a script for the \fBed\fR(1) editor that incorporates into
 107 \fIfilename1\fR all changes between \fIfilename2\fR and \fIfilename3\fR (that
 108 is, the changes that normally would be flagged \fB====\fR and \fB====3\fR).
 109 .sp
 110 Text lines that consist of a single dot (\fB\&.\fR defeat the \fB-e\fR option.
 111 .RE
 112 
 113 .sp
 114 .ne 2
 115 .na
 116 \fB\fB-E\fR \fR
 117 .ad
 118 .RS 7n
 119 Produce a script that incorporates all changes between \fIfilename2\fR and
 120 \fIfilename3\fR, but treat overlapping changes (that is, changes that would be
 121 flagged with \fB====\fR in the normal listing) differently. The overlapping
 122 lines from both files are inserted by the edit script, bracketed by
 123 \fB<<<<<<\fR and \fB>>>>>>\fR lines.
 124 .RE
 125 
 126 .sp
 127 .ne 2
 128 .na
 129 \fB\fB-x\fR \fR
 130 .ad
 131 .RS 7n
 132 Produce a script to incorporate only changes flagged \fB====\fR.
 133 .RE
 134 
 135 .sp
 136 .ne 2
 137 .na
 138 \fB\fB-X\fR \fR
 139 .ad
 140 .RS 7n
 141 Produce a script that incorporates only changes flagged \fB====\fR, but treat
 142 these changes in the manner of the \fB-E\fR option.
 143 .RE
 144 
 145 .sp
 146 .ne 2
 147 .na
 148 \fB\fB-3\fR \fR
 149 .ad
 150 .RS 7n
 151 Produce a script to incorporate only changes flagged \fB====3\fR.
 152 .RE
 153 
 154 .SH USAGE
 155 .sp
 156 .LP
 157 See \fBlargefile\fR(5) for the description of the behavior of \fBdiff3\fR when
 158 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
 159 .SH FILES
 160 .sp
 161 .ne 2
 162 .na
 163 \fB\fB/tmp/d3*\fR \fR
 164 .ad
 165 .RS 23n
 166 
 167 .RE
 168 
 169 .sp
 170 .ne 2
 171 .na
 172 \fB\fB/usr/lib/diff3prog\fR \fR
 173 .ad
 174 .RS 23n
 175 
 176 .RE
 177 
 178 .SH EXIT STATUS
 179 .sp
 180 .LP
 181 The following exit values are returned:
 182 .sp
 183 .ne 2
 184 .na
 185 \fB\fB0\fR \fR
 186 .ad
 187 .RS 6n
 188 Successful completion.
 189 .RE
 190 
 191 .sp
 192 .ne 2
 193 .na
 194 \fB\fB1\fR\fR
 195 .ad
 196 .RS 6n
 197 An error occurred. A difference was found or there was a fatal error.
 198 .RE
 199 
 200 .sp
 201 .ne 2
 202 .na
 203 \fB\fB>1\fR\fR
 204 .ad
 205 .RS 6n
 206 A fatal error occurred.
 207 .RE
 208 
 209 .sp
 210 .LP
 211 Return values do not work the same as \fBdiff\fR(1) or other vendor's versions
 212 of \fBdiff3\fR.
 213 .SH ATTRIBUTES
 214 .sp
 215 .LP
 216 See \fBattributes\fR(5) for descriptions of the following attributes:
 217 .sp
 218 
 219 .sp
 220 .TS
 221 box;
 222 c | c
 223 l | l .
 224 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 225 _
 226 CSI     Enabled
 227 .TE
 228 
 229 .SH SEE ALSO
 230 .sp
 231 .LP
 232 \fBdiff\fR(1), \fBattributes\fR(5), \fBlargefile\fR(5)
 233 .SH NOTES
 234 .sp
 235 .LP
 236 Files longer than 64 Kbytes do not work.