procmail
[Top] [All Lists]

variable $\{trick}

2005-01-08 04:40:45
With variables, I like the ${var} form, with the curly brackets.

But sometimes I need $\var, and you cannot do $\{var} or ${\var}. 

It is a real pity that ${\var} doesn't work.

A variant that will work, is ${:-$\var}.
 
test.rc:

  DEFAULT = /dev/null
  VERBOSE = on

  var = "abc[def]h+ij"

  quoted_var = "${:-$\var}"

Run with: 

  procmail ./test.rc < /dev/null


Of course, this is never really needed, because you can allways 
append an empty () to the variable name in a regexp, to separate 
the variable name from the following text, even when not needed.

-- 
Grtz, Ruud

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>