.\" .\" Copyright (c) 2005 Jeroen Ruigrok van der Werven .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $DragonFly: src/usr.bin/shlock/shlock.1,v 1.6 2008/05/02 02:05:07 swildner Exp $ .\" .Dd July 24, 2005 .Dt SHLOCK 1 .Os .Sh NAME .Nm shlock .Nd create lock file from shell script .Sh SYNOPSIS .Nm .Op Fl d .Op Fl f Ar name .Op Fl p Ar pid .Op Fl u .Sh DESCRIPTION The .Nm utility tries to create a lock file named .Ar name and writes the process id .Ar pid into this file. .Pp Options: .Bl -tag -width Fl .It Fl d Enable debugging. .It Fl f Ar name The filename of the lock file. .It Fl p Ar pid The process id that will be written to file. .It Fl u Use UUCP style lock file format. .El .Sh EXAMPLES A typical use could be (from within a script): .Pp .Dl "shlock -f script.lock -p $$" .Sh DIAGNOSTICS The .Nm command exists with 0 on success or with >0 if there was a problem. .Sh HISTORY The .Nm command appeared in .Dx 1.3 .