procmail
[Top] [All Lists]

Re: using sed to snip signatures

1997-06-11 14:15:00
On Jun 11,  1:05pm -0500, dattier(_at_)wwa(_dot_)com (David W. Tamkin) wrote:
T. C. Thomas asked,

| Can you tell me how to do this (chop signature with sed)?

  :0Bfw
  * ^-- *$
  | sed '/^-- *$/,$ d'

provided, of course, that the start of the signature is marked with the
traditional separator.
-- End of excerpt from dattier(_at_)wwa(_dot_)com

The traditional separator would dictate using

   :0Bfw
   * ^-- $
   | sed '/^-- $/,$ d'

In other words, the separator ought to be hyphen, hyphen, space on a
line by itself.

This is not to say that everyone uses correct separators. Once upon a
time, mail and news user agents would generate the correct separator
automatically, but this seems to be less and less the case.  It's
unfortunate there's an invisible character in the separator, because
people have, um, lost sight of it as the net mutates.

== Bob
   who formerly signed himself "-- Bob" until somebody's broken
   software decided my name was the start of a .signature.