Countdown bash function

To be put in your .bashrc. Combines a waiting period with a (simple) progress report.

countdown () { [ "$1" != "" ] || return && i=$1; while [ $i -gt 0 ]; do i=$(($i-1)); echo -n "$i " ; sleep 1; done; echo "LIFTOFF"; }

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.