procmail
[Top] [All Lists]

Removing multiple spaces from Subject lines was Re: long mailing-list names in Subject line

2001-04-04 07:05:34
On Tue, 3 Apr 2001, Timothy Luoma <elists(_at_)1stpc(_dot_)org> wrote:

      SUBJECT=`formail -xSubject: | sed s'/\[scfn-list\] //g'`

Inspired by this suggestion I tried to use sed so as to eliminate multiple
spaces in Subject lines.

Here's a live one from a list

Subject:      Re: spelling  diagonal angle

I have an existing rule that inserts a tag at the start of the text so I
get:

Subject: [TAG]     Re: spelling  diagonal angle

but what I want is

Subject: [TAG] Re: spelling diagonal angle

that is all multiple spaces removed. So i changed the sed script to be

SUBJECT=`formail -xSubject: | sed s'/  / /'g`

which worked in as much as it took out some of the multiple spaces. A
couple where left in. Fiddling about the sed script I tried

SUBJECT=`formail -xSubject: | sed ": loop s'/  / /'g t loop"`

but that results in various errors being reported. Nothing gets assigned
to SUBJECT, of course.

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