Originally from: Implementing Semaphores in the Shell 10/6/2004 By Ed Schaefer and John Spurgeon for UNIX Review Summary: The authors present a Korn shell implementation of a counting semaphore. The link to the artilce (and in theory the source code) I found for it at: http://unix.ittoolbox.com/documents/implementing-semaphores-in-the-shell-15726 is dead. In this directory you will find: semaphore.tar - the original downloadable source code semaphore.patch - my patch to fix a logic bug and make it run on modern ksh's README - this file Enjoy.