The mydist Shell Script

[return-to Explanation of mysend] [table of contents] [index]
#! /bin/sh
# $Id: mydist,v 1.2 92/08/03 08:45:38 jerry book2 $
### mydist - workaround for dist/sendproc problem in "mysend"
### Usage: use as shell alias or function, or rename to "dist"
##
##  THERE SEEMS TO BE A BUG IN MH 6.7.2 (AT LEAST) THAT WON'T
##  PASS THE -dist SWITCH TO THE post COMMAND IF AN EXTERNAL
##  sendproc (LIKE mysend) IS USED.  THE RESULT IS ERRORS LIKE
##  THESE IF YOU USE THAT sendproc DURING THE dist COMMAND:
##      What now? send
##      post: illegal header line -- Resent-To:
##      ...
##  THIS IS A FRONT-END dist SHELL SCRIPT THAT MAKES A
##  TEMPORARY COPY OF YOUR MH PROFILE WITHOUT ITS sendproc: ENTRY.
##  THEN IT RUNS THE REAL dist AND USES THAT MH PROFILE.
##
##  INSTALL THIS AS A C SHELL ALIAS OR BOURNE SHELL FUNCTION.
##  OR, RENAME THIS TO dist AND PUT IT IN YOUR SEARCH PATH BEFORE
##  THE REAL dist COMMAND.  THE "NOTE" MESSAGE WILL REMIND YOU.

echo "NOTE: using workaround $0" 1>&2
stat=1  # DEFAULT EXIT STATUS; RESET BY dist
tempprfl=/tmp/MYDIST$$
trap 'rm -f $tempprfl; exit $stat' 0 1 2 15
sed '/^[Ss]endproc:/d' ${MH-$HOME/.mh_profile} >$tempprfl || exit
MH=$tempprfl /usr/local/mh/dist $*
stat=$?     # SAVE STATUS FROM dist FOR exit IN trap
exit

[Table of Contents] [Index] [Return to Explanation of mysend] [The mysend Shell Script]


Last change $Date: 1996/06/06 15:13:48 $

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.