I am new to bash, and need to use flock or something similar
in order to lock a file. How can I do this from bash?
I need to lock a file, block until its locked and if my bash process dies - release the lock automatically. If I use another process to do the locking,
the release part is easy, but I'll need to somehow block in the bash script until that process gets the lock. I'm not sure how to do this and if this is the simplest way to achieve what i need.