diff3compare three text files |
Command |
diff3 [-bEeHhXx3]
file1 file2 file3 [mark1[mark3]]
diff3 command compares three versions of a text file
(found in file1, file2 and file3) on a line by line basis
using the diff command.
diff3 marks ranges of disagreeing text lines with one of
the following headers:
====1only file1 is different.
====2only file2 is different.
====3only file3 is different.
====there are differences in all three files.
The label f says which of the three files is being described: 1, 2, or 3. The first label form shows a change in file f from lines m to n inclusive, with the actual text following the label line. The second form indicates that the following text is appended after line n of file f.f:m,nc f:na
diff3 to produce an
editing script instead of the output described earlier. All scripts consist of
commands for the line-oriented text editor
ed, that can be run on this script to
make the indicated changes to file1.
-bignores white space preceding the newline at the end of each line and
considers strings of white space elsewhere in input lines to be equivalent.
For example if one file contained a string of three spaces and a tab at a
given location while the other file contained a string of two spaces at
the same location, diff3 would not report this as a
difference.
-Eis similar to -e, except that it also checks for
overlapping ranges of lines in the changes. diff3
highlights these ranges in the output.
-eproduces an editor script of only those changes flagged
==== or ====3.
-Htells diff to use the
-H option when called by
diff3.
-htells diff to use the
-h option when called by
diff3.
-Xis similar to -x except that it also checks for
overlapping ranges of lines in the changes. diff3
highlights these ranges in the output.
-xproduces an editor script of only those changes where all three files differ.
-3produces an editor script containing changes that occur only in file3.
-E and -X options,
diff3 highlights overlapping regions as follows:
If you specify the arguments mark1 and/or mark3 on the command line,<<<<<<<< file1 lines from file1 ======== lines from file3 >>>>>>>> file3
diff3 uses them as labels in this sort of highlighting
instead of the names of file1 and file3.
This simply prints file1 incorporating the changes between file2 and file3; but it does not save those changes.(diff3 -e file1 file2 file3 ; echo '1,$p') | ed -s file1
This edits file1 and saves the changes.(diff3 -e file1 file2 file3; echo 'wq') | ed -s file1
DIFFPATHspecifies the full path name of the
diff utility called by
diff3. If not set, the
diff utility found using the
normal search path is called.
0There were no differences among the three files.
1Some differences were found.
2Failure due to any of the following
diffdiffdiff--- difference separator2+nWith the options that check for overlapping differences
(-E and -X), the status indicates
that there were n overlapping ranges of differences; for example, a
status of 3 indicates one overlap.
The executable file for diff
is not found in any directory in the PATH
environment variable. Check the setting of this variable.
For some reason, the diff
command was unable to complete its task. If you receive this message,
please contact technical support.
One of the three input files was not able to be opened for reading for the reason given.
To handle certain types of overlapping differences correctly,
diff3 must sometimes allocate memory to hold these
changes temporarily. This message should not happen under normal
circumstances.
diff3 must store output from the
diff command in a temporary
working file. This message is given when this temporary file cannot be
created. You should have either a /tmp directory or have set
the TMPDIR environment variable to another
directory that exists and has space for creating files.
diff3 operates by calling the
diff command and processing the
output that results. Any of these messages indicates that
diff3 received unexpected output from
diff. Since this should not
happen, please contact technical support if you receive any of these
messages.
This message is given if you do not specify the correct number of input files.
-E, -H, -h, and
-X options are extensions to traditional implementations
of diff3.