This program is mostly for MH systems before version 6.8. If you have MH 6.8 or later, you'll probably want to use mhparam instead. The Section Settings from the MH Profile gives an overview of this script. Here is the mhprofile script (you might want to open it in a separate browser window). To install it, see the Section Programs in This Book's Archive.
This program returns two different nonzero exit statuses -- the same way that grep(1) does. The calling program might want to know the difference. If mhprofile doesn't find a matching entry in the MH profile, it returns status 1. If there was some other error (like an invalid option), mhprofile returns 2.
Set the grep variable to the pathname of a program that has a -i (case-insensitive search) option and handles regular expressions. If you don't have a grep which does that, get a freely-available alternative like the GNU version from the Free Software Foundation.
The profile shell variable holds the pathname of the MH profile. It's a bad idea to assume that the user always wants to use .mh_profile in the home directory. If the MH environment variable has been set, this script uses that pathname instead of the default.
This script doesn't handle profile entries that are more than one line long (that contain a newline character, that is). That's because grep will only return the line that starts with the matching entry name.
[Table of Contents] [Index] [Previous: Explanation of fols] [Next: Explanation of mimecat]
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 <firstname.lastname@example.org>