On Mon, Aug 03, 2009 at 08:25:00PM +0200, Kurt Roeckx wrote:
> Package: procmail
> Version: 3.22-16
> Severity: grave
>
> Hi,
>
> It seems that the !- doesn't always have an effect on the return
> value:
[...]
So it seems the manpage says this:
Using lockfile as the condition of a loop in a shell script can be done
easily by using the -! flag to invert the exit status. To prevent
infinite loops, failures for any reason other than the lockfile already
existing are not inverted to success but rather are still returned as
failures.
[...]
WARNINGS
The behavior of the -! flag, while useful, is not necessarily intu-
itive or consistent. When testing lockfile's return value, shell
script writers should consider carefully whether they want to use the
-! flag, simply reverse the test, or do a switch on the exact exit-
code. In general, the -! flag should only be used when lockfile is
the conditional of a loop.
So I think it's actually a bug in the script instead. It does:
if lockfile -! -l 3600 $LOCKFILE; then
echo "Cannot lock $LOCKFILE"
exit 1
fi
But I think I need to think about this some more.
Kurt
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]