while read line do grep -o . <<<$line | while read a do sleep 0.$((RANDOM%3)) #2>&1 echo -n "${a:- }" | tee /dev/tty echo -n "${a:- }" | tee /dev/tty done sleep 0.$((RANDOM%7)) 1>&2 echo -ne $"\n" echo sleep 1.0 done