procmail
[Top] [All Lists]

Re: chomp command

2004-03-03 21:13:17
At 22:18 2004-03-03 -0500, Christopher Benson wrote:
Is there some kind of "chomp" command with procmail? I'm looking for something that will take a subject like and make it < 60 characters. If it's over 60 then it just gets chopped off. I was hoping I wouldn't have to pipe out to a perl script if I didn't have to.

:0fh
* ^Subject:\/............................................................
| formail -I "Subject:$MATCH"

If there are not at least 60 characters (the number of dots), the match will not score a hit, and therefore there will not be the overhead of the pipe to formail. If there are 60 or more characters, then $MATCH will contain just the first 60 (inclusive of leading whitespace, if any -- you didn't define your condition otherwise).

If you are not keenly aware, formail is part of the procmail distribution.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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