mhparam - Man Page

print nmh profile and context components


mhparam [-help] [-version] [components] [-all] [-component | -nocomponent] [-debug]


mhparam writes the value of the specified profile component to the standard output, separated by newlines.  Component name matching is case-insensitive.  If the profile component is not present, the default value (or nothing, if there is no default) is printed.

If the switch -component is given, then the component name is displayed along with the profile components value.  This can be disabled with the switch -nocomponent.

If more than one component is specified in the components list, then the switch -component is on by default.  If only one component is specified, then the switch -nocomponent is on by default.

If -all is specified, then all components in the nmh profile are displayed and other arguments are ignored.

mhparam can provide other information, such as the nmh version identifier, the locations of the nmh bindir, libexecdir, etcdir, and docdir install directories, all proc settings, and the datalocking method described in the mh-profile(5) man page.  Information about the configuration of the nmh installation is also available, including the default mail spool locking method.  To test whether the configuration includes support for SASL, TLS, iconv(3), and oauth, the following commands, respectively, will output a non-null string to indicate support:

mhparam sasl
mhparam tls
mhparam iconv
mhparam oauth

Conversely, no output means that the specified support is not included. The -debug switch displays all such other information available from mhparam.

Note that the internal libdir component has been replaced by libexecdir. The old form is deprecated and will be removed in a future release.


% mhparam path

% mhparam mhlproc

% mhparam -component Path
Path: Mail

% mhparam AliasFile rmmproc
AliasFile: aliases
rmmproc: rmmproc

% mhparam -nocomponent AliasFile rmmproc

% mhparam path nonexistent context
Path: Mail
context: context

% mhparam version

% mhparam etcdir

% mhparam libexecdir

% mhparam spoollocking

% mhparam datalocking

% mhparam sasl

% mhparam tls

% mhparam iconv

% mhparam oauth

mhparam is also useful in backquoted operations:

% fgrep `mhpath +`/`mhparam aliasfile`

Exit Status

mhparam returns the number of components that were not found, but limits the return value to 120 to avoid ambiguity, e.g. 127 is used by shells to indicate `command not found', and 256 would wrap to 0, falsely indicating success.


$HOME/.mh_profileThe user profile
or $MHRather than the standard profile
<mh-dir>/contextThe user context
or $MHCONTEXTRather than the standard context

Profile Components

context:To determine the context file

See Also



`-nocomponent' if only one component is specified
`-component' if more than one component is specified
`components' defaults to none



Referenced By

mhfixmsg(1), mh-folders(5), mh-mime(7), mhshow(1), nmh(7), send(1).

2017-02-18 nmh-1.7.1