I\'m looking for mutex/semaphore/concurrency mechanism in shell script. Consider following situation: Unless \"a\" user does not close the shared file, \"b\" user should no
See BashFAQ and ProcessManagment for discussions on file locking in Bash.
Tagging your question as shell (only) limits the number of people that can help you. You may want to add unix, ksh, bash.
There are numerous questions/answers on this topic posted here already on S.O.
I hope this helps.