procmail
[Top] [All Lists]

rm a non-existent file

1997-10-15 22:13:07
I'm a newcomer to this list and procmail so please bear with me and
forgive me if my question is off beam.

From what I've figured out procmail acts up if you carry out an invalid
shell command. In my recipe I want to delete a file and I assume I have
to check if it exists first. Is this assumption correct?

I want to place a message in "mailfile", overwriting its previous
contents, not appending the message to the file (and I'm not certain
that "mailfile" exists yet).
I came up with the following recipe which works but looks really clumsy
and over-cautious to me. There must be a better way to do it. Any
suggestions would be appreciated. 


:0 c: mailfile.lock
* ? test -e mailfile
| rm mailfile


:0 : mailfile.lock
mailfile


Finally, is that lockfile needed?

TIA

R Henderson

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