Skip to content

Instantly share code, notes, and snippets.

@kopiro
Last active March 18, 2021 12:12
Show Gist options
  • Save kopiro/9051106ab5d9826b82a140bc69ee4d16 to your computer and use it in GitHub Desktop.
Save kopiro/9051106ab5d9826b82a140bc69ee4d16 to your computer and use it in GitHub Desktop.
Monitor directory change and execute a command
#!/bin/sh
while (true); do
inotifywait . -m -r -e create -e modify -e move -e delete
./execute-command.sh
done
#!/bin/bash
# brew install watch md5
while (true); do
watch --chgexit "find . -type f -exec md5 {} \;"
./execute-command.sh
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment