Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
gdiffmk(1)		     General Commands Manual		      gdiffmk(1)

Name
     gdiffmk - mark differences between groff/nroff/troff files

Synopsis
     gdiffmk [-a add-mark] [-c change-mark] [-d delete-mark] [-x diff-command]
	     [-D [-B] [-M mark1 mark2]] [--] file1 file2 [output-file]

     gdiffmk --help

     gdiffmk --version

Description
     gdiffmk  compares	two  roff(7)  documents, file1 and file2, and writes an-
     other, derived from both, to the standard output stream  (or  output-file),
     adding margin character (mc) requests at places in the output where the in-
     put  documents differ.  gdiffmk does not interpret the source documents; it
     treats roff comments and nilpotent changes  to  formatting  as  meaningful.
     For  example,  it does not know that \h'3m', \h'(1 * 3m)', and \h'3m+0' all
     mean the same thing.  If the file1 or file2 argument is "-", gdiffmk  reads
     the  standard  input  stream  for	that  input.   If  the output operand is
     present, gdiffmk writes output to a file of that name.  If it is "-" or ab-
     sent, gdiffmk writes output to the standard output stream.  "-"  cannot  be
     both an input and output operand.

Options
     --help  displays  a  usage message and --version shows version information;
     both exit afterward.

     -a add-mark
	    Annotate material absent from file1 but present in file2  with  add-
	    mark (default: "+").

     -B     Suppress  br requests normally inserted by -D option.  Use with cau-
	    tion; such requests are the only way to guarantee that deletions and
	    small changes are marked.

     -c change-mark
	    Annotate material differing between file1 and file2 with change-mark
	    (default: "|").

     -d delete-mark
	    Annotate material present  in  file1  but  absent  from  file2  with
	    delete-mark (default: "*").

     -D     Mark changed and deleted material with surrounding delimiters.

     -M mark1 mark2
	    Use  mark1	(default:  "[[") and mark2 (default: "]]") as delimiters
	    when using the -D option.

     -x diff-command
	    Use the diff-command program to perform the comparison of file1  and
	    file2.   diff-command  (default:  diff) must accept GNU diff(1)'s -D
	    extension option.

     --     Treat all subsequent arguments as file names,  even  if  they  begin
	    with "-".

Exit status
     gdiffmk exits with status 0 if the input files are the same; 1 if they dif-
     fer;  2  upon a usage error; 3 if the system's diff(1) or sh(1) commands do
     not support features gdiffmk requires; and 4 if the output  argument  is  a
     duplicate of file1 or file2.

Caveats
     The  output  is  not necessarily compatible with all macro packages or pre-
     processors.  A reliable workaround is to run gdiffmk on the output  of  the
     final preprocessor instead of the input source.

     gdiffmk  relies on the -D option of GNU diff to make a merged "#ifdef" out-
     put format.  Busybox diff is  known  to  not  support  it.   Also	see  the
     -x diff-command option.

Authors
     gdiffmk  was written by Mike Bianchi, now retired.  It is maintained by the
     groff developers.

See also
     groff(1), nroff(1), troff(1), roff(7), diff(1)

groff 1.24.1			   2026-03-14			      gdiffmk(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=gdiffmk&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help