I've always wondered how installation scripts created spinners, and counters, etc.. So, I played around and come up with this #!/bin/bash TIMER=60 DIVISOR=1 COUNTER=${TIMER} C=0 while [ $COUNTER -gt 0 ] do case "$(($C % 4))" in 0) char="/" ;; 1) char="-" ;; 2) char="\\" ;; 3) char="|" ;; esac echo -ne "${char} -- ${COUNTER} \r" COUNTER=$[$COUNTER-$DIVISOR] C=$[$C+1] sleep $DIVISOR done echo -ne '\n'
Linux: The whole world made it for you... This blog is a collection of things I come across either at home or at work as a Linux Administrator. I have worked as an Admin working with Solaris, SAN, Backups and Linux at the Enterprise level for over 16 years.