procmail
[Top] [All Lists]

[autoresponder] testing existence of requested file

1999-11-29 00:10:12
Hi,

I tried to improve my autoresponder, but it doesn't work as expected.
With this part i'll try to test if the file exists:

        FILE_TEST = `/usr/bin/test -f $FILEDIR2/$MATCH`
        :0Ehcw
        * $TEST_TEST ?? 0

As far as i know the output of 'test -f <file>' should be 0 if true and
1 if false. So, testing for 0 or 1 should tell me whether the file
exists, isn't it?

However, it doesn't work as expected:

  procmail: Executing "/usr/bin/test,-f,/home/rejo/send/data.txt"
  procmail: Assigning "FILE_TEST="
  procmail: No match on "0"

The file /home/rejo/send/data.txt does exist.

Any idea's what my problem is here? I guess it is because the exitcode
of test is zero or one, not it's output. True? And if so, how to capture
that exitcode instead of it's output?

Thanks in advance, -Rejo.

-- 
= Rejo Zenger  [Sister Ray Crisiscentrum]               
rejo(_at_)sisterray(_dot_)xs4all(_dot_)nl
= http://mediaport.org/~sister                                  PGP: see headers
--------------------------------------------------------------------------------