Last active
May 18, 2016 17:37
-
-
Save andykais/85e8586ffc46f6bb78c9 to your computer and use it in GitHub Desktop.
autorun a command when a file is saved
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/sh | |
FORMAT=$(echo -e "\033[1;33m%w%f\033[0m written at $(date +'%r')") | |
clear | |
while true | |
do | |
clear\ | |
&& echo "[Running \"$@\" on files changes in $(pwd) at $(date +'%r')]"\ | |
&& echo ""\ | |
&& echo "$@" > /home/andrew/bin/data/lastroc.sh\ | |
&& bash /home/andrew/bin/data/lastroc.sh 0>/dev/null \ | |
&& sleep .3; | |
inotifywait -qre close_write --format "$FORMAT" . | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment