procmail
[Top] [All Lists]

Re: spamrule - re without references

2003-07-15 01:29:45
On Mon, Jul 14, 2003 at 05:54:28PM -0700, Tyler Creelan wrote:
Professional Software Engineering wrote:

    SPAMMISHNESS="${SPAMMISHNESS}${SPAMVAL}"

Sorry this is redundant, but why are the {} braces are 
recommended around the variables? I know it relates to 
whitespace inside the variable, but what exactly breaks 
if you leave them off?

Actually it has to do with being specific about the variable name. Roughly,
the value of the variable whose name appears inside the braces is concatenated
with the string following the closing brace.
        $VAR1=green
        ${VAR1}x == "greenx"
        $VAR1x == An unrelated variable named "VAR1x"

Also does this reason apply in the bourne shell?

Absolutely.

Procmailrc(5):

        The assignments and substitutions of these  environment  variables are
        handled exactly like in sh(1) (that includes all possible quotes and
        escapes)

-- 
Andrew Edelstein        -       http://andrew.pure-chaos.com/resume.txt

Please do not reply directly to me, or Cc: me on a reply to a list message.
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>