procmail
[Top] [All Lists]

Re: using formail and sed to remove subject cruft

2001-08-12 21:22:14
Doug Porter wrote,

|     SUBJECT=`echo $SUBJECT | sed -e 's/\['$LIST'\][ ]*//i'`

I'm too sleepy to absorb the whole thing, but isn't /i for a
case-insensitive match a perlism?  As far as I know, no version of sed
honors it.  Also, I don't know what was supposed to be between the second
pair of brackets there.  Generally, if [ is followed immediately by ] or ^],
the right bracket is considered part of the (complemented, in the latter
case) character class and the regexp engine keeps looking for another right
bracket to close the class, and you don't have one there; to my knowledge
that applies to all utilities that use regexps.  So I wouldn't be surprised
if that sed instruction were invalid.

Other problems in that same line could be that the opening value of $SUBJECT
or the value of $LIST could have characters that mess up the shell
interpretation.  Both really should be placed in weak quotes rather than
left unquoted.


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