procmail
[Top] [All Lists]

Re: strlen() in procmail

2003-01-14 21:23:02
At 13:36 2003-01-14 -0800, Bart Schaefer wrote:
:0
* 1^1 STRING ?? > 1
{
 LOG="The length of $STRING is $=
"
}

El Chinche Grandioso:

STRING is zero length, then the score is zero, and the action isn't taken. Thus, for completeness:

#---
STRLEN=0

:0
* 1^1 STRING ?? > 1
{
        STRLEN=$=
}

LOG="The length of $STRING is $STRLEN$NL
#---

Of course, perhaps you want to not display string length for a zero length string, or to have a blank strlen when it is zero length (though the latter won't happen as originally written - it'll be whatever STRLEN was last set to).

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