procmail
[Top] [All Lists]

Re: How to pipe only if certain file exists?

2005-07-12 16:00:12
On Tue, Jul 12, 2005 at 02:54:27PM -0700, Ric Otte wrote:

But Jake's doesn't seem to work.  In my log I get the entry:
    procmail: Extraneous filter-flag ignored
    procmail: Skipped "test -x /usr/bin/qsf"
    From otte(_at_)ucsc(_dot_)edu Tue Jul 12 14:47:28 2005
     Subject: test 2
       Folder: ?        
and a folder '?' is created and the message stored there.  I think I
have exactly what you suggested:
    :0wf
    ? test -x /usr/bin/qsf
    | /usr/bin/qsf -sra

No, you forgot the asterisk for a condition line.  Without the
asterisk, procmail thinks that line is where you expect delivery:
to a file called "?", followed by some garbage that is ignored.


  * ? test -x /usr/bin/qsf


Note that this and the syntax I suggested are really just alternate
ways of saying the same thing.  The above is equivalent to

  * ? [ -x /usr/bin/qsf ]

See "man test" for more about that.

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

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