Created
May 24, 2019 04:00
-
-
Save kaskichandrakant/acdb44fae11e656df70e7d156d72423a to your computer and use it in GitHub Desktop.
This file contains 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 | |
watch() { | |
echo watching folder $1/ every $2 secs. | |
while [[ true ]] | |
do | |
files=`find $1 -type f -mtime -$2s` | |
if [[ $files != "" ]] ; then | |
echo changed, $files | |
fi | |
sleep $2 | |
done | |
} | |
watch dir_name 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment