lunes, 15 de julio de 2019

Very simple file watcher

#!/bin/bash

chsum1=""

while [[ true ]]
do
    chsum2=`find koans/ -type f -exec md5sum {} \;`
    if [[ $chsum1 != $chsum2 ]] ; then
    printf "\033c" #clear screen       
        groovy AllKoans.groovy #command
        chsum1=$chsum2
    fi
    sleep 2
done