procmail
[Top] [All Lists]

Re: MATCH operator and subject adjustment

2001-11-12 18:35:18
Paul Chvostek asked:
:0
* [condition to identify list]
*     ^Subject:[      ]\/.*\[[a-z0-9]+\].*
{
      :0
      { NEWSUBJ=`echo "${MATCH}" | sed -E 's/\[[a-zA-Z0-9-]+] //'` }

      :0 f
      | formail -I "Subject: $NEWSUBJ"
}
...
Is there a more elegant way to do this?  In particular, is there a
way to do this without calling a subshell to run sed?

This should do:

  # unset SHELLMETAS to prevent use of a shell
  OLDSHELLMETAS="$SHELLMETAS"
  SHELLMETAS

  :0 fhw
  * ... other conditions ...
  * ^Subject:.*\[[a-z0-9]+]
  | sed '/^Subject:/s/\[[a-zA-Z0-9]*] //'

  # restore old value
  SHELLMETAS="$OLDSHELLMETAS"

/HW

PS:

On Sun, Nov 11, 2001 at 08:50:43AM -0800, Professional Software Engineering 
wrote:
[fullquote]

Could you trim your quotings, please? Thanks.
_______________________________________________
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>