procmail
[Top] [All Lists]

RE: Returning a value to a recipe

2009-03-09 04:40:35
Nigel Allen wrote further on Monday, March 09, 2009 7:41:

This is my first attempt at this - anyone care to comment?

   :0E
   STAFF = `grep $FLDR /etc/staff_codes.txt| awk -F":" ' 
{print $2} END 
{if (NR == 0) print "Null" } '`
   * ! STAFF ?? Null
   {
      "$STAFF/"
   }

You can't put an assignment statement in the middle of a recipe like
that.

Rcfiles can contain recipes, assignments statements, and comments.
But recipes can't start and then have an assignment statement
in the middle and then continue.[1]

Modernly, recipes can contain comment lines.  (This wasn't always
true.)  But you still can't stick a comment at the end of a condition
line, either.

See, of course, my previous post about a way to do what you want.

[1] There's a tricky way to effectively do it (or better said,
fake it) with the match token, though, because MATCH is volatile.  
But that has nothing to do with your needs here -- I'm just stating 
it for completeness's sake.

Dallman

____________________________________________________________
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