procmail
[Top] [All Lists]

Re: Testing Values

1997-04-23 23:23:00
Roy Rapoport <rsr(_at_)shadowfx(_dot_)ide(_dot_)com> writes:
I'd like the ability to do something like this in a recipe:

FOO=`program`

:0:
* FOO=?val
whatever

(basically, have FOO get the value from a program (which you can
do now very easily) and check if the value of foo is something,
in which case the condition is satisfied.

Is this possible?

Yes.  To quote the procmailrc(5) manpage:

     variablename ??
          Match the remainder of this condition against the value
          of  this environment variable (which cannot be a pseudo
          variable).  A special case is if variablename is  equal
          to  `B',  `H',  `HB' or `BH'; this merely overrides the
          default header/body search area defined by the  initial
          flags on this recipe.


:0:
* FOO ?? ^^some-regexp^^
whatever

The ^^'s force the regexp to match *all* of the value of FOO, not just
part of it.

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>
  • Testing Values, Roy Rapoport
    • Re: Testing Values, Philip Guenther <=