while true do if test $1 -nt .lastRun then kill `cat .lastRun` ./$1& echo $! started diff $1~ $1 cp $1 $1~ echo $! > .lastRun fi done