Skip to content

Instantly share code, notes, and snippets.

@rzymek
Last active December 27, 2015 13:29
Show Gist options
  • Save rzymek/7333379 to your computer and use it in GitHub Desktop.
Save rzymek/7333379 to your computer and use it in GitHub Desktop.
#!/bin/bash
files=""
while [ "$1" != "--" ];do
echo ">>"$1
files="$files $1"
shift
done
shift
cmd="$*"
#events=close_write
events=modify
echo $files
echo $cmd
while true; do
inotifywait -e "$events" $files
bash -c "$cmd"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment