Skip to content

Instantly share code, notes, and snippets.

@m1tk4
Created November 8, 2018 00:02
Show Gist options
  • Save m1tk4/57714ad7437b57a0900b5727adbd01df to your computer and use it in GitHub Desktop.
Save m1tk4/57714ad7437b57a0900b5727adbd01df 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