Created
December 11, 2016 11:45
-
-
Save Intey/aa46d35b6c1f954c17c4be46bbbf018c to your computer and use it in GitHub Desktop.
wait file change and execute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
file=$1 | |
shift | |
let changed=0 | |
while [[ $changed -eq 0 ]]; do | |
inotifywait -e CLOSE_WRITE $file -qo /dev/null && changed=$? | |
echo "update with: $@" | |
$@ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment