procmail
[Top] [All Lists]

quotes in LOG= (was Kind of functions in procmail)

2001-11-18 07:46:36
When Heddy had this code,

B>         LOG="${SPAMKILLERTAG}: ${SPAMREASON}
B> "

Paul wondered,

C> I'm not sure what you're trying to do with the double quotes.  Perhaps
C> they should be another nesting level of curly braces?

and thought it should be like this:

C> LOG="${XSPAMKILLERHEADER}: ${SPAMREASON}"

No, Heddy's original is right.  When text is assigned to the LOG variable,
it is written exactly as it is to the logfile, with no implicit trailing
newline.  So if the assigned value of $LOG doesn't already include an
explicit newline, the next thing written to the logfile will start to the
right of the text from $LOG instead of beginning down on the next line.  The
design is intentional; this way one can write part of a line at a time to
the logfile by using $LOG.  If a newline were written automatically, that
would be impossible.

Heddy's code includes the trailing newline needed there.  In Paul's
suggestion, unless $SPAMREASON already ends in an explicit newline, the
write to the logfile would end without a newline and the next text added to
the logfile would start at the right of $SPAMREASON rather then below it.



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