Marks differences between files.
diffmk [ { -abX | -aeX ] [ -b ] [ -cbX | -ceX ] [ -dbX | -deX ] File1 File2 [ File3 ]
The diffmk command compares the English-language file specified by the File1 parameter with the file by the File2 parameter. It then creates a third file that includes .mc requests (for creating change marks) for the nroff and troff commands. The File1 and File2 parameters specify the old and new versions, respectively, of the files. The diffmk command writes the newly created file to the File3 parameter, if specified, or else to standard output. The File3 file contains the lines of the File2 file plus inserted formatter .mc requests. When the File3 file is formatted, the changed or inserted text is marked by a | (vertical bar) at the right margin of each line. An * (asterisk) in the margin indicates that a line was deleted.
If the DIFFMARK environment variable is defined, it names a command string that the diffmk command uses to compare the files. (Normally, the diffmk command uses the diff command.) For example, to handle extremely large files better, you can set the DIFFMARK variable to diff -h.
diffmk chap1.old chap1 chap1.nroff
This produces a copy of chap1 containing nroff and troff change mark requests to identify text that has been added to, changed in, or deleted from chap1.old. This copy is saved in the chap1.nroff file.
diffmk -ab'>>New:' -ae'<<End New' \ chap1.old chap1 chap1.nroff
This causes the diffmk command to write >>New: on the line before a section of newly added lines to chap1, and to write <<End New on the line following the added lines. Changes and deletions still generate nroff and troff commands to put a | (vertical bar) or * (asterisk) in the margin.
diffmk -b -cb'.mc %' chap1.old chap1 chap1.nroff
This imbeds commands that mark changes with % (percent sign) additions with a | (vertical bar), and deletions with an * (asterisk). It does not mark changes that only involve a different number of spaces or tabs between words (-b).
The diff command, nroff command, troff command.