Skip to content

Instantly share code, notes, and snippets.

@jesusgoku
Created November 5, 2014 11:27
Show Gist options
  • Save jesusgoku/5e2714b0d7abbffdeba2 to your computer and use it in GitHub Desktop.
Save jesusgoku/5e2714b0d7abbffdeba2 to your computer and use it in GitHub Desktop.
Example to utilize flock to run script only if not previous running
#!/bin/bash
{
flock -x -w 200 || exit 1
yes First
yes Second
yes Third
} 200>~/.lock/my_yes_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment