Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!pmafire!uudell!bigtex!texsun!newstop!exodus!ural.Eng.Sun.COM!loren From: loren@ural.Eng.Sun.COM Newsgroups: comp.unix.questions Subject: Re: Eliminating Duplicate Mail Headers Message-ID: <12817@exodus.Eng.Sun.COM> Date: 3 May 91 20:59:11 GMT References: <13@oss670.UUCP> <1669@aupair.cs.athabascau.ca> Sender: news@exodus.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 23 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@cup.portal.com P.O. Box 36195 San Jose, CA 95158