procmail
[Top] [All Lists]

Re: varname=| construct broken?

2004-02-20 16:33:59
Toen ik Ian D. kietelde, kwam er dit uit:

As for variable scoping, try this.  I get "MYVAR is foo".  Notice the
"Forking" line.  I think any variables set by a child won't be seen
by the parent, if typical UNIX fork() mechanisms are used.

--------------- start ---------------
VERBOSE = on
MYVAR = "foo"
:0c
{
  MYVAR = "bar"
  :0
  /dev/null
}
LOG = "
MYVAR is $MYVAR
"

Something else to consider: procmail stops at delivery, so without
the c-flag, the LOG would not show MYVAR.
If you would remove the delivery (to /dev/null) the LOG would show both
values.

I often put the PID at the start of the LOG-line:

  LOG = "$$${TAB}MYVAR is $MYVAR$NL"

-- 
Affijn, Ruud


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail