On Fri, 28 Mar 2003 the voices made Dallman Ross write:
DR> On Fri, Mar 28, 2003 at 10:04:21PM +0100, Tony L. Svanstrom wrote:
DR> > On Fri, 28 Mar 2003 the voices made John Ehrlinger write:
DR> >
DR> > JE> I was trying to use sed because I wanted to delete the entire
DR> > header to JE> the first blank line (see the sample message).
DR> >
DR> > How about a quick hack that'll make it all work while the local
DR> > experts are coming up with the perfect solution? =)
DR> >
DR> > :0f
DR> > * ^From jehrling(_at_)bio\(_dot_)ri\(_dot_)ccf\(_dot_)org
DR> > | perl -ne 'print && next if $a; $a++ if /^$/'
DR> >
DR>
DR> Tony, if all the world were a nail, you'd use perl. (Or something
DR> like that.)
Hey, I said it was a quick hack. =)
DR> There is *no* reason to be loading that humongo perl thing into memory
DR> for each message he gets. And even if formail, which four people have
DR> already mentioned, couldn't do this trivially, and even if procmail
DR> couldn't delete a header natively all by itself, well, sed would be
DR> fine here.
DR>
DR> | sed '1,/^$/ d'
I've been trying to use sed instead of perl whenever possible, but it's hard
to convince yourself to use a mostly unknown and limited tool when the humongo-
part of perl in most situations isn't a problem... Just to prove that I'm wrong
I am right now working on a project where my usual perl-thinking would just get
me into trouble. =)
DR> But we don't need it, or perl. (Though if we did, we would want the
DR> w and h flags on the recipe.)
Well, if you used the h-flag you could get the perl down to being just "perl
-ne ''"; but wouldn't that result in an e-mail with no headers, an empty line
(ie ^$) and then the body... which wouldn't be a solution to the problem?
Just ignore that question if you want to, I'm sandboxing it asap (most likely
not before sunday); but right now I'm about to fall asleep and dream about the
house I'm going to start building tomorrow. =)
DR> :0 b # forward just the body
DR> * ^From:(_dot_)*(_at_)bio\(_dot_)ri\(_dot_)ccf\(_dot_)org
DR> ! forward(_at_)address
You da man.
--
/\___/\ /\___/\
\_@ @_/ \_@ @_/
+--oOO-(_)-OOo------------------------------------------oOO-(_)-OOo--+
| Per scientiam ad libertatem! // Through knowledge towards freedom! |
+---ôôô---ôôô--------------------------------------------ôôô---ôôô---+
\O/ \O/ (c)1998-2003 tony(_at_)svanstrom(_dot_)com \O/ \O/
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail