home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


merge [options ] [diff3 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 .

merge accepts the -A , -e , and -E options for diff3 , and simply passes them on, causing diff3 to perform the corresponding kind of merge. See the entry for diff3 in Chapter 2, Unix Commands , for details. (The -A option is for the GNU version of diff3 .)


-L label

This option may be provided up to three times, providing different labels in place of the filenames file1 , file2 , and file3 , respectively.


Send merged version to standard output instead of to file1 .


Produce overlap insertions but don't warn about them.

Previous: Reference: ident UNIX in a Nutshell: System V Edition Next: Reference: rcs
Reference: ident Book Index Reference: 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