Eliminating Duplicate Mail Headers

loren at ural.Eng.Sun.COM loren at ural.Eng.Sun.COM
Sat May 4 06:59:11 AEST 1991


In comp.mail.headers you write:

>I'm not able to fix the mailer myself, but can pass its output
>through standard filters--awk, sed, etc.--before it goes
>out the door.  My first thought was to pass things through 'uniq',
>but this would also delete consecutive identical lines in the body (the
>mailer doesn't distinguish between header and body).  The probability
>of consecutive, identical lines in the body of mail messages seems
>low, but not low enough to chance this.

I expect an AWK script is the best choice if you don't want to use PERL.
I can't rember AWK syntax since I've started using PERL (How quickly
I forget :)  But you basically want to delete any adjacent duplicate
lines until the end of the header (first blank line) and then copy the
rest of the file as is.  If you wanted a PERL solution, I would have
written it.  Hope this is of some help.

Loren

-----------------------------------------------------------------------------
Mr Loren L. Hart                        The Ada Ace Group, Inc
loren at cup.portal.com                    P.O. Box 36195
                                        San Jose, CA  95158



More information about the Comp.unix.questions mailing list