diff3(1) MPE/iX Shell and Utilities diff3(1)
______________________________________________________________________
NAME
diff3 -- compare three text files
SYNOPSIS
diff3 [-EeHhXx3] file1 file2 file3 [mark1[mark3]]
DESCRIPTION
The diff3 command compares three versions of a text file found in
file1, file2, and file3 on a line by line basis using the diff(1)
command.
diff3 marks ranges of disagreeing text lines with one of the fol-
lowing headers:
====1 only file1 is different.
====2 only file2 is different.
====3 only file3 is different.
==== there are differences in all three files.
After the header, label lines of either of the two following
forms may appear to show what differences apply to which file:
f:m,nc
f:na
The label f says which of the three files is being described; it
is 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.
Options
All of the following options tell diff3 to produce an editing
script instead of the output described earlier. All scripts con-
sist of commands for the line-oriented text editor ed(1), which
can then be run on this script to make the indicated changes to
file1.
-E is similar to -e, except that it also checks for overlap-
ping ranges of lines in the changes. diff3 highlights
these ranges in the output.
-e produces an editor script of only those changes flagged ====
or ====3.
-H tells diff to use the -H option when called by diff3.
-h tells diff to use the -h option when called by diff3.
1
diff3(1) MPE/iX Shell and Utilities diff3(1)
______________________________________________________________________
-X is similar to -x except that it also checks for overlapping
ranges of lines in the changes. diff3 highlights these
ranges in the output.
-x produces an editor script of only those changes where all
three files differ.
-3 produces an editor script containing changes which occur
only in file3.
Under the -E and -X options, diff3 highlights overlapping regions
as follows:
<<<<<<<< file1
lines from file1
========
lines from file3
>>>>>>>> file3
If you specify the arguments mark1 and/or mark3 on the command
line, diff3 uses them as labels in this sort of highlighting
instead of the names of file1 and file3.
EXAMPLES
Here are two commands that you can submit to the shell.
(diff3 -e file1 file2 file3 ; echo '1,$p') | ed -s file1
This simply prints file1 incorporating the changes between file2
and file3; it does not save those changes.
(diff3 -e file1 file2 file3; echo 'wq') | ed -s file1
This edits file1 and saves the changes.
DIAGNOSTICS
Possible exit status values are:
0 There were no differences among the three files.
1 Some differences were found.
2 An error occurred.
2+n With 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.
Messages
Message: cannot find "diff" command
Cause: diff3 was unable to find the diff command.
2
diff3(1) MPE/iX Shell and Utilities diff3(1)
______________________________________________________________________
Action: Make sure that the directory which contains diff is
included in the setting of the PATH environment vari-
able.
Message: child process: system error
Cause: diff3 was unable to fork to run diff due to a system
error. See syserror(3).
Action: See syserror(3).
Message: "diff" command failed
Cause: For some reason, diff returned an unexpected error code
and was unable to complete its function.
Action: Contact your system manager.
Message: diffnvs3: expecting `---'; got `string'
Cause: diff3 received unexpected output from diff.
Action: Contact your system manager.
Message: diffnvs3: bad control line line
Cause: diff3 received unexpected output from diff.
Action: Contact your system manager.
Message: diffnvs3: unexpected end of file
Cause: diff3 received unexpected output from diff.
Action: Contact your system manager.
Message: file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Insufficient memory
Cause: diff3 was unable to allocate storage for all lines in
the input files.
Action: Free up more system resources or break up the files.
Message: no temporary files available: system error
Cause: See syserror(3).
Action: See syserror(3).
Message: opening temporary file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Unknown option "-option"
Cause: You specified an option that is not valid for diff3.
Action: Check the DESCRIPTION section for a list of valid diff3
options.
Message: You must specify exactly 3 input files
Cause: You did not specify exactly 3 input files on the com-
mand line.
Action: Specify 3 input files.
3
diff3(1) MPE/iX Shell and Utilities diff3(1)
______________________________________________________________________
LIMITS
The longest input line is restricted to 1024 characters.
PORTABILITY
All UNIX systems.
The -E, -H, -h, and -X options are extensions to traditional
implementations of diff3.
MPE/iX NOTES
For information on how the current MPE/iX implementation may
affect the operation of this utility, see Appendix A, MPE/iX
Implementation Considerations.
SEE ALSO
diff(1), ed(1)
4