#!/bin/bash

reprintLines() {
  let -i end=$1
  for (( ii=0; ii < end; ii++));do
    echo -ne "\033[2K" #clear line
    echo -ne "\033[1A" # go up 1
  done
  echo -ne "\033[G" #move to begin of line
}

for ii in {0..10};do
  printf "Lets count to 10!\n"
  printf "%3d\n" "$ii" # don't print \n
  sleep 1s
  if [[ $ii -lt 10 ]];then
    reprintLines 2
  fi
done