Unfortunately, however, that does the job only if the file exists. If
the file *doesn't* exist, lockfile creates it, and then I need an
additional fork for rm to remove it.
Good point. However, if you tell it to create 2 lockfiles, one of which
it will never be able to create, it will tidy up after itself.
lockfile -r0 plainfile /dev/null/blah
Obviously it will never be able to create the file 'blah' in the
The exitcode will differ depending on whether or not 'plainfile' exists.
It'll return 69 if plainfile is there, and 73 if it isn't. Of course,
you then need to do extra work to grab and test the return value:
DUMMY=`lockfile -r0 plainfile /dev/null/blah`
* RET ? 69
which seems like too much pain when head will do the job.
Martin McCarthy /</ http://procmail.non-prophet.org
`Procmail Companion' \>\
Addison Wesley /</ PGP key available
procmail mailing list