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