werner@aecom.UUCP (Craig Werner) (08/03/85)
I have yet to figure out how to strip saved news articles of all their header information in an elegant fashion. If anybody has such information, I'd like to see it. In the absence of that, I'd like to submit the following inelegant solutions. Two egrep scripts which do much of the dirty work for news, and mail, respectively: ee - for news articles em - for mail Craig Werner ------------------------------------------------------------------------- ee(0) NOT-UNIX ee(0) NAME: ee SYNOPSIS: ee [filename] DESCRIPTION: ee is a quick and dirty solution to removing the Headers from saved news articles. CODE: egrep -v \^Relay-\|\^Posting-\|\^Path:\|\^Message-ID:\|\^Date-Received:\ \|\^Lines:\|\^Xref\|\^Expires\|\^Followup-To:\|\^Reply-To:\ \|\^Distribution: $1 > $1.ee mv $1.ee $1 BUGS: It's so ridiculously inelegant. It only handles one filename, the ability to 'ee *' would be nice. It also might inadvertantly erase lines of the message, but not likely. The egrep script leaves in Date:, Newsgroup:, and References: lines. This is not really a bug, just my own taste. The expression could be modified. ------------------------------------------------------------------------- em(0) NOT-UNIX em(0) NAME: em SYNOPSIS: em [filename] DESCRIPTION: similar to ee only for net-mail. CODE: egrep -v \^Received\|\^Return-Path\|\^Original-From:\|\^Message-Id:\ \|\^Apparently-To: $1 > $1.em egrep -v "id AA" $1.em > $1 rm $1.em BUGS: same as for ee. Also, if id's someday start not beginning with AA, em will not accomplish its purpose. ------------------------------------------------------------------------- -- Craig Werner !philabs!aecom!werner "The world is just a straight man for you sometimes"