UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: identChapter 18
The RCS Utility
Next: Reference: rcs
 

merge

merge [options] file1 file2 file3

Perform a three-way merge of files (via diff3) and place changes in file1. file2 is the original file. file1 is the "good" modification of file2. file3 is another, conflicting modification of file2. merge finds the differences between file2 and file3, and then incorporates those changes into file1. If both file1 and file3 have changes to common lines, merge warns about overlapping lines and inserts both choices in file1. The insertion appears as follows:

<<<<<<< file1>
lines from file1
========
lines from file3
>>>>>>> file3

You'll need to edit file1 by deleting one of the choices. merge exits with a status of 0 (no overlaps), 1 (some overlaps), or 2 (unknown problem). See also rcsmerge.

Options

-L text1

In overlapping lines, replace the label "<<<<<<< file1" with the label "<<<<<<< text1".

-L text3

In overlapping lines, replace the label "<<<<<<< file3" with the label "<<<<<<< text3". Valid only with -L text1.

-p

Send merged version to standard output instead of to file1.

-q

Produce overlap insertions but don't warn about them.


Previous: Reference: identUNIX in a Nutshell: System V EditionNext: Reference: rcs
Reference: identBook IndexReference: rcs

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System