There is a simple C program that opens / writes / closes a .bin file using flock() . I would like to make the same lock in the bash script, which will copy this .bin to avoid simultaneous work with the file.
As I understood from the help ( https://linux.die.net/man/1/flock ) this lock can be made, but will it cooperate with the sishny flock() ?
If yes, then I beg you to show a simple example script that shows work with flock.