Mac OS X equivalent of Linux flock(1) command

file-locking, flock, macos, shell

Solution

There is a cross-platform flock command here:

https://github.com/discoteq/flock

I have tested it and it works well on OSX as a drop-in replacement for the util-linux flock.

Problem

Is there a flock command on Mac OS X that manages file lock? http://linux.die.net/man/1/flock

Original source