procmail
[Top] [All Lists]

Re: Removing multiple spaces from Subject lines

2001-04-06 04:29:01
On Fri, 6 Apr 2001, Dallman Ross <dman(_at_)nomotek(_dot_)com> wrote:

From: Trevor Jenkins <trevor(_dot_)jenkins(_at_)suneidesis(_dot_)com>

Now to solve the problem of overly long subject lines. (formail returns
the line break.)

The following section of sed code, taken from a longer set of statements

I tried a completly different approach to this part of the problem
(expunging multiple spaces). I used tr with its --squeeze-repeats
option. Works fine. :-)

Although it might be less efficient to run tr than sed, using tr makes it
obvious even to a dunce like me what is meant to happen. Indeed tr can be
used to rid the line break introduced by my MTA/MDA/MUA during the
delivery processes.

My original receipe had this environment variable assignment

SUBJECT=`formail -zxSubject: | sed -e "s/[      ][      ]*/ /g"`

(with a single space and a tab in the brackets) now the assignment is:

SUBJECT=`formail -zxSubject: | tr "\n" " "| tr --squeeze-repeats " "`

I want to thank all those (amongst them Timothy J. Luoma, David R. Linn,
Dallman Ross, Lars Hecking, Don Hammond, Stan Ryckman) who provided
suggestions during this thread. Your assistance has taught me lots about
procmail. It will come in handy soon.

Regards, Trevor

British Sign Language is not inarticulate handwaving; it's a living language.
Support the campaign for formal recognition by the British government now!

-- 

<>< Re: deemed!





_______________________________________________
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>