procmail
[Top] [All Lists]

Re: Removing list footers -- and sed case insensitivity

2004-12-22 09:34:35
* Justin Gombos wrote:

But when I try to use the 'I' flag on the following experimental
version of the script above:

  :0 fbw
  * ^X-BeenThere:.*procmail
  | sed -e '/^[ \t]*$/N \
            /^[ \t]*\n__*/N \
            /^[ \t]*\n__*[ \t]*\nProcMail.*org\//,/http.*ProcMail$/Id'

it fails to delete the address space, and the footer remains in the
message.  Can anyone see what my problem is?

Each of the regular expressions that specify an address range can have
its own modifier. You're only asking for a case-insensitive match on
the end of the address range, but not on the beginning. Compare:

# echo -e "One\nTwo\nThree\nFour" | sed "/two/,/three/d"
One
Two
Three
Four
# echo -e "One\nTwo\nThree\nFour" | sed "/two/I,/three/d"
One
# echo -e "One\nTwo\nThree\nFour" | sed "/two/I,/three/Id"
One
Four

Add another "I" before the comma in your last line to make both
regexes case-insensitive.

/HW

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail