This is a simple script with watch for file modification and execute a command when this occurs.
Examples:
watch ./gen fic1 fic2 dir1 watch "echo 'This file changed:' " dir1 dir2