procmail
[Top] [All Lists]

Re: removing line

2002-01-21 14:50:51
Rikard asked,

| I'm kinda new to this and I wonder how to simply remove a line from the
| body of a message containg a certain sentence or words in a procmail
| filter, before delivering the message.

 :0Bbfw
 * pattern
 | grep -v 'pattern'

That will remove every line that the pattern is on.  If it can appear more
than once and you want to remove only the first occurrence, you can use this
action line instead:

 | sed -e '1,/pattern/{' -e'/pattern/d' -e '}'

If you want to delete only the second, or third, or Nth, or last, it gets a
lot more complicated.




_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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