procmail
[Top] [All Lists]

How to remove multiple newlines

2004-07-14 16:04:13
I have a special address me-lo(_at_)me(_dot_)tld, that I use to save bits of 
text I
might find interesting.
Example:
  :0
  * ^Subject:.*todo.*
  | formail -I "" >> $HOME/todo
everything sent to me-lo(_at_)me(_dot_)tld, with a subject containing "todo", 
gets
shoved in my todo file on my home directory. However, usually there is a
leading and trailing newline, after formail gets rid of all the headers. I
could just strip all newlines from the message, like so:
  | formail -I "" | tr -d '\n' >> $HOME/todo
But the problem with that is that if I want to put multiple todo items in
one file, like this:
  * stare off into nothingness contemplating the meaningless of the universe
  * kill a cat
  * solve world hunger - tell no one
, then all of those things end up on one line.

A little long, but... any ideas? it seemed like the answer was always
right around the corner on the google search, but I never could come up
with anything that worked. Thanks!

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>