# man > COMP(1mh)

- Compare files interactively::
  `comp`
- Compare two specified files::
  `comp path\to\file1 path\to\file2`
- Compare two sets of files::
  `comp path\to\directory1\* path\to\directory2\*`
- Display differences in decimal format::
  `comp {{path}} path\to\file1 path\to\file2`
- Display differences in ASCII format::
  `comp {{path}} path\to\file1 path\to\file2`
- Display line numbers for differences::
  `comp {{path}} path\to\file1 path\to\file2`
- Compare files case-insensitively::
  `comp {{path}} path\to\file1 path\to\file2`
- Compare only the first 5 lines of each file::
  `comp {{path}}=5 path\to\file1 path\to\file2`

*Source: cheat.sh*

---

[_COMP_(1mh)](https://www.chedong.com/phpMan.php/man/COMP/1mh/markdown)                                                                                  [_COMP_(1mh)](https://www.chedong.com/phpMan.php/man/COMP/1mh/markdown)

## NAME
       comp - compose an nmh message

## SYNOPSIS


       **comp **[**-help**] [**-version**] [_+folder_] [_msg_] [**-form _**formfile_] [**-use **| **-nouse**] [**-file _**file_]
            [**-draftfolder _**+folder_] [**-draftmessage _**msg_] [**-nodraftfolder**] [**-editor _**editor_] [**-noedit**]
            [**-width _**columns_] [**-from _**address_] [**-to _**address_] [**-cc _**address_] [**-fcc _**+folder_] [**-subject**
            _text_] [**-whatnowproc _**program_] [**-nowhatnowproc**] [**-build**]

## DESCRIPTION
       **comp **is used to create a new message to be mailed.  It copies a message form to the draft be‐
       ing  composed and then invokes an editor on the draft (unless **-noedit **is given, in which case
       the initial edit is suppressed).

       The default message template “components” will direct **comp **to construct the message draft  as
       follows:

            From: {from switch} or <Local-Mailbox> or <username@hostname>
            To: {to switch} or blank
            cc: {cc switch} or blank
            Fcc: {fcc switch} or +outbox
            Subject: {subject switch} or blank
            --------

       If  a  file named “_components_” exists in the user's nmh directory, it will be used instead of
       this form.  You may specify an alternate forms file with the switch **-form _**formfile_.

       You may also start **comp **using the contents of an existing message as the form.  If you supply
       either a _+folder_ or _msg_ argument, that message will be used as the message form.  You may not
       supply both a **-form _**formfile_ and a _+folder_ or _msg_ argument.  The line of dashes  or  a  blank
       line  must be left between the header and the body of the message for the message to be iden‐
       tified properly when it is sent (see [_send_(1)](https://www.chedong.com/phpMan.php/man/send/1/markdown)).

       The switch **-use **directs **comp **to continue editing an already started message.  That is,  if  a
       **comp  **(or  **dist**,  **repl**,  or  **forw**)  is terminated without sending the draft, the draft can be
       edited again via “**comp -use**”.

       The **-file _**file_ switch says to use the named file as the message draft.

       Forms that are selected via the **-form **switch are processed via the **nmh **template  system;  see
       [_mh-format_(5)](https://www.chedong.com/phpMan.php/man/mh-format/5/markdown)  for details.  Drafts constructed from another message or with the **-use **or **-file**
       switches will _not_ be processed with [_mh-format_(5)](https://www.chedong.com/phpMan.php/man/mh-format/5/markdown).

       In addition to the standard [_mh-format_(5)](https://www.chedong.com/phpMan.php/man/mh-format/5/markdown) escapes, the following _component_ escapes are  either
       new or have an alternate meaning:

            _Escape_  _Returns_  _Description_
            fcc     string   Any folders specified with `-fcc folder'
            from    string   Any addresses specified with `-from address'
            to      string   Any addresses specified with `-to address'
            cc      string   Any addresses specified with `-cc address'
            subject string   Any text specified with `-subject text'

       By  default the “To:” and “cc:” fields are empty.  You may add addresses to these fields with
       the **-to _**address_ and **-cc _**address_ switches.  You may give these switches multiple times to  add
       multiple addresses.

       By  default  the  “From:”  field has either the value of the **Local-Mailbox **profile entry or a
       system default email address.  This default can be overridden  by  using  the  **-from  _**address_
       switch.   The  default mailbox in the “Fcc:” field is _+outbox_.  This can be overridden by the
### -fcc 

       Any text you give to the **-subject **switch will be placed in the “Subject:” field in the draft.

       If the draft already exists, **comp **will ask you as to the disposition of the draft.   A  reply
       of  **quit  **will  abort **comp**, leaving the draft intact; **replace **will replace the existing draft
       with the appropriate form; **list **will display the draft; **use **will use the  draft  for  further
       composition;  and  **refile _**+folder_ will file the draft in the given folder, and give you a new
       draft with the appropriate form.  (The _+folder_ argument to **refile **is required.)

       The **-draftfolder _**+folder_ and **-draftmessage _**msg_ switches invoke the **nmh **draft folder facility.
       This is an advanced (and highly useful) feature.  Consult [_mh-draft_(5)](https://www.chedong.com/phpMan.php/man/mh-draft/5/markdown) for more information.

       The **-editor _**editor_ switch indicates the editor to use for the  initial  edit.   Upon  exiting
       from  the  editor,  **comp  **will invoke the **whatnow **program (see [_whatnow_(1)](https://www.chedong.com/phpMan.php/man/whatnow/1/markdown) for a discussion of
       available options).  The invocation of this program can be inhibited by using the **-nowhatnow‐**
       **proc **switch.  (In fact, it is the _whatnow_ program which  starts  the  initial  edit.   Hence,
### -nowhatnowproc 

       The  **-build  **switch  is  intended  to be used by the Emacs mh-e interface to **nmh**.  It implies
### -nowhatnowproc
       that would normally be presented to the user for editing.  No mail is actually sent.

## FILES
       /etc/nmh/components The default message skeleton.
       <mh-dir>/components The user's message skeleton.
       $HOME/.mh_profile   The user's profile.

## PROFILE COMPONENTS
       Path:               To determine the user's nmh directory.
       Draft-Folder:       To specify the default draftfolder.
       Editor:             To override the default editor.
       Msg-Protect:        To set mode when creating a new message (draft).
       fileproc:           Program to refile the message.
       whatnowproc:        Program to ask the “What now?” questions

## SEE ALSO
       [_dist_(1)](https://www.chedong.com/phpMan.php/man/dist/1/markdown), [_forw_(1)](https://www.chedong.com/phpMan.php/man/forw/1/markdown), [_repl_(1)](https://www.chedong.com/phpMan.php/man/repl/1/markdown), [_send_(1)](https://www.chedong.com/phpMan.php/man/send/1/markdown), [_whatnow_(1)](https://www.chedong.com/phpMan.php/man/whatnow/1/markdown), [_mh-draft_(5)](https://www.chedong.com/phpMan.php/man/mh-draft/5/markdown), [_mh-profile_(5)](https://www.chedong.com/phpMan.php/man/mh-profile/5/markdown)

## DEFAULTS
       +folder             The current folder.
       msg                 The current message.
### -nodraftfolder
### -nouse

## CONTEXT
       None

## BUGS
       If  _whatnowproc_  is  **whatnow**, then **comp **uses a built-in **whatnow**, it does not actually run the
       **whatnow **program.  Hence, if you define your own _whatnowproc_, don't call it **whatnow **since **comp**
       won't run it.

nmh-1.8                                      2022-12-22                                    [_COMP_(1mh)](https://www.chedong.com/phpMan.php/man/COMP/1mh/markdown)
