Files
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

238 lines
4.1 KiB
Plaintext

.\" @(#)diff3.1v 1.1 94/10/31 SMI; from UCB 6.2 8/20/85
.TH DIFF3 1V "9 September 1987"
.SH NAME
diff3 \- display line-by-line differences between 3 files
.SH SYNOPSIS
.B diff3
[
.B \-exEX3
]
.I filename1
.I filename2
.I filename3
.SH SYSTEM V SYNOPSIS
.B /usr/5bin/diff3
[
.B \-ex3
]
.I filename1
.I filename2
.I filename3
.SH AVAILABILITY
The System V version of this command is available with the
.I System V
software installation option. Refer to
.TX INSTALL
for information on how to install optional software.
.SH DESCRIPTION
.IX "System V commands" "\fLdiff3\fR"
.IX "diff3 command" "" "\fLdiff3\fP \(em three-way differential compare"
.IX files "compare, three-way differential \(em \fLdiff3\fR"
.IX compare "three-way differential \(em \fLdiff3\fR"
.B diff3
compares three versions of a file,
and publishes disagreeing ranges of text
flagged with these codes:
.RS
.TP 11
.B ====
All three files differ
.TP
.B ====1
.IR filename1 " is different"
.TP
.B ====2
.IR filename2 " is different"
.TP
.B ====3
.IR filename3 " is different"
.RE
.LP
The types of differences between a given range within
the given files are indicated in one of these ways:
.RS
.TP 11
.IB f : \|n1 a
Text is to be appended after line number
.I n1
in file
.I f,
where
.I f
= 1, 2, or 3.
.TP
.IB f : \|n1 , \|n2 c
Text is to be
changed in the range line
.I n1
to line
.IR n2 .
If
.I n1
=
.IR n2 ,
the range may be abbreviated to
.IR n1 .
.RE
.LP
The original contents of the range follows immediately
after a
.B c
indication.
When the contents of two
files are identical, the contents of the lower-numbered
file is suppressed.
.SH OPTIONS
The options to
.B diff3
instruct it to produce a script for the editor
.BR ed ,
rather than a list of differences. This script will incorporate some or
all of the differences between
.I filename2
and
.I filename3
into
.IR filename1 .
This script will not include a
.B w
or
.B q
command at the end, so that it will not write out the changed file.
.TP
.B \-e
Produce a script that will incorporate all changes between
.I filename2
and
.IR filename3 ,
that is, the changes that normally would be flagged
.RB ` ==== '
and
.RB ` ====3 '.
.TP
.B \-x
Produce a script that will incorporate only changes flagged
.RB ` ==== '.
.TP
.B \-3
Produce a script that will incorporate only changes flagged
.RB ` ====3 '.
.TP
.B \-E
Produce a script that will incorporate all changes between
.I filename2
and
.IR filename3 ,
but treat overlapping changes (that is, changes that would
be flagged with
.B ====
in the normal listing) differently. The overlapping
lines from both files will be inserted by
the edit script, bracketed by
.B <<<<<<
and
.B >>>>>>
lines.
.TP
.B \-X
Produce a script that will incorporate only changes flagged
.BR ==== ,
but treat these changes in the manner of the
.B \-E
option.
.br
.ne 16
.IP
For example, suppose lines 7-8 are changed in both
.I filename1
and
.IR filename2 .
Applying the edit script generated by the command
.sp .5
.RS
.nf
.BI "diff3 \-E " "filename1 filename2 filename3"
.fi
.RE
.IP
to
.I filename1
results in the following file.
.br
.ne 11
.RS
.sp .5
.nf
.B lines 1-6
.BI "of " filename1
.BI "<<<<<<< " filename1
.B lines 7-8
.B "of " filename1
.B =======
.B lines 7-8
.BI "of " filename3
.BI ">>>>>>> " filename3
.BI "rest of " filename1
.fi
.RE
.SH SYSTEM V OPTIONS
The System V version of
.B diff3
does not support the
.B \-E
and
.B \-X
options. The script produced by the
.BR \-e ,
.BR \-x ,
and
.B \-3
options
.I does
include a
.B w
and
.B q
command at the end, so that
it
.I will
write out the changed file.
.SH EXAMPLES
The following command will incorporate all the changes between
.I filename2
and
.I filename3
into
.IR filename1 ,
and print the resulting file to
the standard output. If the System V
version of
.BR diff3 ,
is used,
.I filename1
will be replaced with the resulting file.
.sp .5
.RS
.nf
.BI "(diff3 \-e " "filename1 filename2 filename3" "; echo \'1,\|$p\'\|) \(bv ed \- " filename1
.fi
.RE
.SH FILES
.PD 0
.TP 20
.B /tmp/d3?????
.TP
.B /usr/lib/diff3
.TP
.B /usr/5lib/diff3prog
.PD
.SH "SEE ALSO"
.BR diff (1),
.BR ed (1)
.SH BUGS
Text lines that consist of a single
.RB ` . '
will defeat a
.B \-e
option.