hur.st's bl.aagh

BSD, Ruby, Rust, Rambling

run-one

Friendly wrapper around lockf/flock, unofficial clone of an Ubuntu package

[shell]

Wanting to hone my shell scripting skills a bit, I ended up reimplementing a cute script by Dustin Kirkland.

run-one is basically a thin wrapper around lockf(1), or on Linux flock(1):

-% lockf /var/tmp/sleep-5.lock sleep 5
# <runs sleep 5 under the named lock>
-% run-one sleep 5
# <runs sleep 5 under a lock named by a SHA256 of its arguments>
Continue Reading