diffmk
PURPOSE
Marks differences between files.
SYNOPSIS
diffmk [ -b ] [ -ab"req" ] [ -ae"req" ] [ -cb"req" ] [ -ce"req" ]
[ -db"req" ] [ -de"req" ] old.version new.version [ marked.file ]
DESCRIPTION
The diffmk command compares file1 and file2 and creates a
third file that includes change mark commands for the
nroff and troff commands. file1 and file2 are the old
and new versions of the file. diffmk writes the newly
created file to file3, if specified, or to standard
output. This file contains the lines of file2 with for-
matter change mark (.mc) requests inserted as appro-
priate. When file3 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 environment parameter DIFFMARK is defined, it
names a command string that diffmk uses to compare the
files. (Normally, diffmk uses the diff command.) For
example, you might set DIFFMARK to "diff -h" in order to
better handle extremely large files.
FLAGS
-abX Uses X to mark where added lines begin.
-aeX Uses X to mark where added lines end.
-b Ignores differences that are only changes in tabs
or spaces on a line.
-cbX Uses X to mark where changed lines begin.
-ceX Uses X to mark where changed lines end.
-dbX Uses X to mark where deleted lines begin.
-deX Uses X to mark where deleted lines end.
EXAMPLES
1. To mark the differences between two versions of a
text file:
diffmk chap1.old chap1 > chap1.nroff
This produces a copy of "chap1" containing
nroff/troff change mark commands to identify text
that has been added to, changed in, or deleted from
"chap1.old". This copy is saved in the file
"chap1.nroff".
2. To mark differences with non-nroff/troff messages:
diffmk -ab'>>New:' -ae'<<End New' chap1.old chap1 >chap1.nroff
This causes diffmk to write ">>New:" on the line
before a section of new lines that have been added to
"chap1" and to write "<<End New" on the line fol-
lowing the added lines. Changes and deletions still
generate nroff/troff commands to put a | or "*" in
the margin.
3. To use different nroff/troff marking commands and
ignore changes in white space:
diffmk -b -cb'.mc %' chap1.old chap1 > chap1.nroff
This imbeds commands that mark changes with "%",
additions with |, and deletions with "*". It does
not mark changes that only involve a different number
of spaces or tabs between words ("-b").
RELATED INFORMATION
The following commands: "diff," "nroff, troff," and
"troff."