#! /bin/sh i=0 while true do clear echo $i ((i++)) read -t 1 -n 1 if [[ $? = 0 ]] then clear exit 0 fi done