procmail
[Top] [All Lists]

Re: Looking for a simple rule to remove a 4 lignes signature.

1998-09-09 07:29:54
Francois Felix Ingrand asked,

| I also would like to remove the signature which is added by onelist
| (something like:
| 
| 
| ------------------------------------------------------------------------
| To unsubscribe from this mailing list, or to change your subscription
| to digest, go to the ONElist web site, at http://www.onelist.com and
| select the User Center link from the menu bar on the left.
| 
| )
| 
| Any hints on how can this be done.... should I use sed, something like
| 
| sed -e /^-----------------------$/,$d

If you can guarantee that no earlier line will match that row of hyphens,
that will work, but it is inefficient, for it keeps reading the rest of
the input to the end, only to discard it anyway.

| or $-4,$d

sed does not understand $-4.  It doesn't know when the last line is coming
until it reads a line in and finds EOF, so when it is four lines from the
end, it has no idea that the end is four lines away.

Here's my recommendation.  It will remove only from the last such line of
hyphens to the end, so if someone overquotes from an earlier post and the
resulting article has two footers, only the second one will be removed.

:0Bbfwi # error in first score is counterbalanced by error in second score
* 1^1 ^.*$
* ^\/-------------*$(([^-].*)?$)*^^
* -1^1 MATCH ?? ^.*$
| sed "$="q