whenfilechanges with glob support

This commit is contained in:
ville rantanen
2014-08-22 09:45:08 +03:00
parent 1d66b7da9a
commit 1f8c32acf5

View File

@@ -137,8 +137,6 @@ Keeps a history of folders visited in ~/.bash_cdhistory
} }
function whenfilechanges() { function whenfilechanges() {
[ -z "$2" ] && { echo 'Usage: whenfilechanges "file" "some" "command" [ -z "$2" ] && { echo 'Usage: whenfilechanges "file" "some" "command"
Follows the modification time of the "file" and runs the command Follows the modification time of the "file" and runs the command
@@ -172,6 +170,7 @@ function whenfilechanges() {
echo "${fname[$i]} changed:" echo "${fname[$i]} changed:"
eval "$@" eval "$@"
otime[$i]=$( stat -c %Z "${fname[$i]}" ) otime[$i]=$( stat -c %Z "${fname[$i]}" )
echo "Waiting for file changes..."
} }
done done
sleep 2 sleep 2