On Fri, Sep 10, 2004 at 02:41:42AM +0200, Ruud H.G. van Tol wrote:
As I wrote before, just one sed-call can do it.
Put this in remove.sed:
/^Bad-header:/!b
:loop
$bend
N
/\n[^[:blank:]]/!bloop
h
s/^\(.*\)\n.*$/\1/;
/bad-string/{
g; s/^\(.*\)\(\n.*\)$/\2/; D;
}
p; g; s/^\(.*\)\(\n.*\)$/\2/; D;
:end
/bad-string/b
d
Put this in your rc:
:0 h fw
* ^Bad-header:.*bad-string
| sed -f remove.sed
Yup, I saved it before when you posted it. Very nice! Unfortunately,
you did it too late in the day to spare me a couple of hours of
unplanned screwing around. :-) The exercise is still useful
if only as a tutorial (partly to myself).
Nice going, Ruud.
Regards,
Dallman
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail