I am trying to create a bash script with 2 parameters:
I want to watch the
To continuously recursively monitor folder (md5) and execute a command on change:
daemon() {
chsum1=""
while [[ true ]]
do
chsum2=`find src/ -type f -exec md5 {} \;`
if [[ $chsum1 != $chsum2 ]] ; then
compile
chsum1=$chsum2
fi
sleep 2
done
}
Works on my OS X as I do not have digest
.
On Linux, you can use md5sum
as a replacement for the md5
command.