Settings from the Environment

[previous] [next] [table of contents] [index]

When an MH command runs, it may set some environment variables to be used by programs it calls. For example, when repl starts its -editor program, the editor can get the value of $editalt from the environment; it holds the pathname of the original message.

The Table below is taken from the mh-profile(5) manual page. For more description of each environment variable, read your online copy of it. The table doesn't include MH environment variables set by parts of MH which this book doesn't cover, such as BBoards. In this table, a "full pathname" means a pathname starting at the root directory like /yourMHdir/inbox/4.

Table: Environment Variables that MH Sets

editalt (set by dist, repl)
Full pathname of message being distributed or replied to.
mhaltmsg (set by dist, repl)
Full pathname of message being distributed or replied to.
mhannotate (set by dist -anno, forw -anno, repl -anno)
If -annotate is used, set to annotation string for original message header: Resent:, Forwarded:, or Replied:.
mhdist (set by dist)
Contains 1 if draft message is being distributed (signal not to allow text in the draft body), 0 otherwise.
mhdraft (set by comp, dist, forw, repl)
Full pathname of the draft message.
mheditor (set by all commands)
Full pathname of text editor program.
mhfolder (set by dist, forw, repl, show, prev, next)
Full pathname of folder that holds the alternate message.
mhinplace (set by dist, forw, repl)
Set to 1 if -annotate -inplace used, to 0 if -annotate is used.
mhmessages (set by dist -anno, forw -anno, repl -anno)
List of message number(s) to annotate; for example, 23-25 34.
mhuse (set by comp)
Set to 1 during comp -use; 0 otherwise.
MHFD (set by all commands)
File descriptor of MH profile (experimental) (only if OVERHEAD configuration option set).
MHCONTEXTFD (set by all commands)
File descriptor of MH context (experimental) (only if OVERHEAD configuration option set).

[Table of Contents] [Index] [Previous: Settings from the MH Profile] [Next: Changing the MH Environment]


Last change $Date: 1996/06/06 15:10:32 $

This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.

Suggestions are welcome: Jerry Peek <jerry@ora.com>

Questions or problems regarding this web site should be directed to Steve Gielda.
Copyright 1999 www.cotse.com.  All rights reserved.
Last modified: Friday April 02, 1999.