procmail
[Top] [All Lists]

Re: How to remove multiple newlines

2004-07-16 15:04:30
Dallman Ross penned,

Yes, it's a nice little sed statement, David.  I believe it is also
equivalent to this:

  sed -n '/./,/^$/p'

Thank you, and yes it is equivalent. I normally would not write it that way, but as procmailrc advice that might be better, for it precludes the need to tell csh users to escape the exclamation point.

And were it not for the leading blank line that the sed statement also
nicely eliminates, it would be equivalent to this, unless I am mistaken:

  cat -s

Only if there are leading blanks in the body proper; the blank line at the neck is eliminated by using the `b' flag without `h' on the colon line.

Btw, just getting rid of the top blank could also be accomplished like so:

  tail +2

Not necessary, because the `b' flag will remove it, unlike an extra process to pipe the entire message through formail -I "".

____________________________________________________________
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