d

diffmk(1)

diffmk(1)

NAME

diffmk - mark changes between two different versions of a ®le

SYNOPSIS

diffmk prev®le curr®le mark®le

DESCRIPTION

diffmk compares the previous version of a ®le with the current version and creates a ®le that includes nroff/troff ``change mark'' commands. prev®le is the name of the previous version of the ®le and curr®le is the name of the current version of the ®le. diffmk generates mark®le which contains all the lines of the curr®le plus inserted formatter ``change mark'' (.mc) requests. When mark®le is formatted, changed or inserted text is shown by a character at the right margin of each line. The position of deleted text is shown by a single *.

If the characters and * are inappropriate, a copy of diffmk can be edited to change them because diffmk is a shell script.

EXTERNAL INFLUENCES

International Code Set Support

Single- and multi-byte character code sets are supported.

EXAMPLES

A typical command line for comparing two versions of an nroff/troff ®le and generating a ®le with the changes marked is:

diffmk prevfile currfile markfile; nroff markfile pr

diffmk can also be used to produce listings of C (or other) programs with changes marked. A typical command line for such use is:

diffmk prevfile.c currfile.c markfile.c; nroff macs markfile.c pr

where the ®le macs contains:

.pl 1

.ll 77

.nf

.eo

The .ll request can specify a different line length, depending on the nature of the program being printed. The .eo request is probably needed only for C programs.

WARNINGS

Aesthetic considerations may dictate manual adjustment of some output.

diffmk does not differentiate between changes in text and changes in formatter request coding. Thus, ®le differences involving only formatting changes (such as replacing .sp with .sp 2 in a text source ®le) with no change in actual text can produce change marks.

Although unlikely, certain combinations of formatting requests can cause change marks to either disappear or to mark too much. Manual intervention may be required because the subtleties of various formatting macro packages and preprocessors is beyond the scope of diffmk. tbl cannot tolerate .mc commands in its input (see tbl(1)), so any .mc request that would appear inside a .TS range is silently deleted. The script can be changed if this action is inappropriate, or diffmk can be run on two ®les that have both been run through the tbl preprocessor before any comparisons are made.

diffmk uses diff, and thus has the same limitations on ®le size and performance that diff may impose (see diff(1)). In particular the performance is nonlinear with the size of the ®le, and very large ®les (well over 1000 lines) may take extremely long to process. Breaking the ®le into smaller pieces may be advisable.

diffmk also uses the ed(1) editor. If the ®le is too large for ed, ed error messages may be embedded in the ®le. Again, breaking the ®le into smaller pieces may be advisable.

SEE ALSO diff(1), nroff(1).

Section 1182

− 1 −

HP-UX Release 11i: December 2000