procmail
[Top] [All Lists]

Re: Variables in output of external programs

1999-05-27 04:29:50
On Wed, May 26, 1999 at 12:19:24AM -0500, Philip Guenther wrote:

Alternatively you can do the eval in the condition itself:

      JFBODYCHK = `cat $JFDIR/jf-bodychk`
      :0 HB
      * $ $ ${JFBODYCHK:-\$JFNOMATCH}
      * < 6000
      {
          :0 B
          * $ $ ()\/($JFBODYCHK)
          { JFMATCH="$JFSEC: $MATCH" INCLUDERC=$JFDIR/junkfilter.match }
      }

This worked beautifully for me.  Thanks, Philip.  I never realized
that multiple levels of expansion could be done with multiple $!
 
Finally, I'll note that the above nested recipe could be done as a
single recipe by using the "B ??" syntax on the third condition:

Since the gain in efficiency is negligible, you should only make that
change if you find it as easy or easier to read.

I find it more difficult to read, although that may pass as I become
more familiar with the "* $ $ $ $ $" notation.  Hopefully I'll never
have to go five levels deep.

Greg
-- 
Gregory S. Sutter                       "How do I read this file?"
mailto:gsutter(_at_)pobox(_dot_)com                "You uudecode it."
http://www.pobox.com/~gsutter/          "I I I decode it?"
PGP DSS public key 0x40AE3052

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