procmail
[Top] [All Lists]

Re: just execute a shell command

1996-03-12 16:46:31
Philip Guenther suggested to Robert Brown,

| :0 i:a_lockfile
| * some condition
| |command to execute
| 
| The 'i' flag tells procmail to not care that the command isn't reading its
| standard input.  That allows you to leave out the "cat >/dev/null;" bit.
| You need to specify the name of the local lockfile as neither
| are you writing to a mailbox nor does the command contain ">>".

That last part depends on a couple considerations:

1. If the command line in the procmail rcfile does contain ">>", a name for
   the local lockfile will be implicit, and the second colon alone is enough.

2. If the command doesn't write to a file, or doesn't write to the same file
   as anything else (including a matching letter that makes procmail run the
   same command) that might run at the same time, the local lockfile is un-
   necessary.

Another usually good suggestion when the action line doesn't need to read
the incoming message is to use the `h' flag (or the `b' flag if the letters
that trigger the recipe are likely to have empty or short bodies).  That will
cut down on the text that procmail tries to feed to a command that won't read
it anyway.

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