procmail
[Top] [All Lists]

Re: conditional recipe execution

1998-01-09 01:13:12
Thu 98-01-08 Geoff Mulligan <geoff(_at_)mulligan(_dot_)com> list.procmail

|   :0 
|   * foo bar1
|   | something
| 
|   :0
|   * foo bar2
|   | something else
| 
|   :0 A
|   | GOOD
| 
|   :0 E
|   | BAD
| }
| 
| but I want GOOD run if either 'foo bar1' or 'foo bar2' is matched and BAD 
| run if neither matched.

I like simple solutions, so my choice is below. 
jari

    flag = ""       # of just plain: flag

    :0
    * condition
    | do1

        :0 E
        { flag = "1" }  # I dont't like oldish =| construct 

    :0
    * condition
    | do2

        :0 E
        { flag = "$flag 2" }

    ...

    :0 
    * flag ?? (1 2)
    | GOOD

    :0 E
    | BAD

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