lsof -c updatedb > udate.txt running=`cat udate.txt | grep -c updatedb` if [ $running = 0 ]; then kdialog --msgbox "updatedb is not running" else until [ $running = 0 ]; do let running=`lsof -c updatedb | grep -c updatedb` done kdialog --msgbox "updatedb is done!" fi rm udate.txt