[vox-tech] simple stupid lockfile example?

Henry House vox-tech@lists.lugod.org
Thu, 20 Mar 2003 21:53:54 -0800


--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 18, 2003 at 04:09:53AM -0500, Mike Simons wrote:
> On Tue, Mar 18, 2003 at 12:58:01AM -0800, Bill Kendrick wrote:
> > i want to replace 'tin' with a shell script or alias that will
> > test for a lock file (and call me a moron if it exists), make a lock fi=
le,
> > run tin, and then delete the lock file...
>=20
> =3D=3D=3D=3D=3D
> #! /bin/bash
>=20
> LOCK=3D$HOME/.tin.lock
>=20
> lockfile $LOCK
> tin
> rm -f $LOCK
> =3D=3D=3D=3D=3D
>=20
> "lockfile" is part of the procmail package.
>=20
>   if you ^C the script, you will have to clean up and delete the lockfile
> on your own.  there are a few ways for the script to automatically
> detect tin was killed, but you didn't ask for that.  ;)

There are a bunch of good shell scripting techniques that may yield some
purchase on your problem in O'Reilly's "Unix Power Tools". (There is a copy
in the LUGOD library.)

--=20
Henry House
The attached file is a digital signature. See <http://romana.hajhouse.org/p=
gp>
for information.  My OpenPGP key: <http://romana.hajhouse.org/hajhouse.asc>.

--qMm9M+Fa2AknHoGS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE+eqjyi3lu92AVGcIRAluXAJ9wHw7GyC52WpHYjITMpo7A9Dv9fwCfTXhs
ktkiRFy3EpCyO5lBj/TK3BA=
=AKe/
-----END PGP SIGNATURE-----

--qMm9M+Fa2AknHoGS--