Skip to content

Instantly share code, notes, and snippets.

@m1tk4
Created November 8, 2018 00:02
Show Gist options
  • Save m1tk4/efa8e5c8d9a912442fd047f04b741887 to your computer and use it in GitHub Desktop.
Save m1tk4/efa8e5c8d9a912442fd047f04b741887 to your computer and use it in GitHub Desktop.
Bash semaphore
( flock -xn 9 && echo 1 && sleep 20 && echo 2 ) 9>>/some/lock/file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment