procmail
[Top] [All Lists]

Re: How to pipe only if certain file exists?

2005-07-12 13:10:38
On Tue, Jul 12, 2005 at 12:21:10PM -0700, Ric Otte wrote:
Hi,

I have a multi-boot machine, and use the same home directory with
different debian distributions.  If I am checking mail and the spam
filter /usr/bin/qsf exists, I would like to pipe my mail through it.
But if it doesn't exist, I don't want to try to pipe the mail through
it.  I tried all sorts of things, such as the following, but all were
unsuccessful:
    :0
    |   test [ -e /usr/bin/qsf ]
        :0 wf
            | qsf -sra
    

This was the closer recpie.  What you're looking for is:

:0wf
? test -x /usr/bin/qsf
| /usr/bin/qsf -sra

I would sugest the -x test for 'FILE exists and is executable' as
opposed to just existance.



-- 
Till Later, Jake <karrde+procmail(_at_)viluppo(_dot_)net>
-----------------------------------------------
Direct replys are likley to be flagged as spam.
Drop the +addy if you need to reply direct.

____________________________________________________________
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