Great Circle Associates List-Managers
(July 1994)

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Looking for useful shell scripts etc
From: Michelle Dick <artemis @ rahul . net>
Date: Thu, 14 Jul 94 22:47:32 -0700
To: jerry @ ora . com
Cc: Malcolm Jackson <cczmjj @ unicorn . ccc . nottingham . ac . uk>, list-managers @ greatcircle . com
In-reply-to: <5134 . 774203836 @ rubble . west . ora . com>

Jerry wrote:
> A sed script to do that looks like:
> 	/^\.$/d
> You can put that in a shell script named "dotfix" and invoke it from the
> "What now?" prompt by typing "edit dotfix".  The script is:
> 	#!/bin/sh
> 	/bin/cp "$1" /tmp/fix$$
> 	/bin/sed '/^\.$/d' /tmp/fix$$ > "$1"
> 	/bin/rm -f /tmp/fix$$
> 	exit 0
> You could add some bug proofing to handle things like a full /tmp, an
> unwritable draft (in the $1 argument, etc.) but that's the basic idea.

I use forw -digest too.  My digest is sent out by cron, so it has to
be automated.  Awhile back I hacked together the following script for
cron.  It isn't pretty and it's kind of kludgy, but it works.  BTW,
the "push" is from Jerry's book.

cp Mail/digest.format Mail/temp.format
scan +fatfree-digest -noreverse -format "     %{subject}" >> Mail/temp.format
forw +fatfree-digest all -digest Fatfree -form temp.format -filter digest.filter -nowhatnowproc
cat `mhpath +drafts cur` | sed -e "s/^\.$/ ./" | rcvstore +drafts
rmm +drafts cur
push next
rmm +fatfree-digest all
rm Mail/temp.format

It first tacks the subject listing to the top of the digest, forms the
digest, removes single dot lines, stores the doctored draft, removes
the old one, sends out the digest, and then clears out the old
messages and extraneous temp.format file.

One error still remains: If any of the subject lines contain a "%"
character, the digest fails to get sent and I have to go in and fix it
by hand the next day.  This happens about once every other month (1
out of 60 times).  A quick fix for this from more knowledgable types
would be appreciated (I guess I should simply pipe the scan output
through sed, replacing "%" with "percent" before catting it to
temp.format).  I plan to (eventually -- sigh) use Steve Berg's
excellent SmartList package to manage this list, but for now, this
very inelegant set of commands does the job.

(BTW, the digest goes out when I'm not logged in, so there's little
danger of my online mail activities clashing with the cron-activated

Michelle Dick       artemis @
 rahul .
 net       East Palo Alto, CA
          Owner, FATFREE Vegetarian Mailing List

Indexed By Date Previous: Re: List Owners vs. System Administrators
From: mcb @ netcom . com (Michael C. Berch)
Next: Re: Looking for useful shell scripts etc
From: Rich Zellich <zellich @ STL-17SIMA . ARMY . MIL>
Indexed By Thread Previous: Re: Looking for useful shell scripts etc
From: Jerry Peek <jerry @ ora . com>
Next: Re: Looking for useful shell scripts etc
From: Rich Zellich <zellich @ STL-17SIMA . ARMY . MIL>

Search Internet Search