procmail
[Top] [All Lists]

Procmail -Sed/ex/ed question.

1999-06-10 12:27:28
This question is related to sed/ex/Unix  filtering used in procmail.

On our project, publisher of mail keep "mailing list name" on message body,
and send attachment with mail text. While formatting the message using
procmail and formail, we delete the name of mailing list. But the PROBLEM
is, this deletion in tern moves  the PDF attachment by a deleted number of
character on message body. I realized that - the systems takes into account
of count of character. If we delete them, it shifts PDF by that count. 

 Following is the recipe, and I would like to change ---> line.
----------------------------------------------------------------------------
----------------------------
:0
* ? fgrep -xis "$SENDER" /home/ess/.procmail/sender_list
* !^Subject:.*\<RE:
* B ?? ^\/.*_list
{
     # Remove line containing subject(<name>_list), from body
     :0 fbw
     | sed -e "s/$MATCH/ /g"   ------>  |sed -e s/$MATCH/COUNT OF
CHARACTER($MATCH) ./g"              ......
----------------------------------------------------------------------------
-------------------------------
i.e.  say MATCH=davinci_list
       it will be replaced by wc -c $MATCH, i.e. 12 character of space or
'.', to place attachment  at correct position.
      
 Do you know how to do this in sh/sed/ex/ed? I can to do it easily by a perl
script, but for efficiency reason, it would be nice if do using simple shell
command in procmail rc file, not calling another external program.

        
        Thanks in advance, mail response directly to my following email
address.
-Tapas

Tapas Banerjee
tapas(_dot_)banerjee(_at_)gs(_dot_)com

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