# gdiffmk

## 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 another, derived from both, to the standard output stream
           (or _output-file_), adding margin character (**mc**) requests at places
           in the output where the input 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 absent, _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 caution; 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 differ; **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 preprocessors.  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” output format.  Busybox _diff_ is known to not support it.
           Also see the **-x** _diff-command_ option.
    


## Authors



           _gdiffmk_ was written by Mike Bianchi ⟨MBianchi@Foveal.com⟩, now
           retired.  It is maintained by the _groff_ developers.
    


## See also



           _groff_(1), _nroff_(1), _troff_(1), _roff_(7), _diff_(1)
    


* * *