## vim:ft=zsh ## Countdown to a specific date/time ## Usage: countdown ## Copyright (C) 2008 by Daniel Friesel ## License: WTFPL autoload check_com typeset -i beep=0 typeset -i seconds if check_com beep; then beep=1 fi while true; do seconds=$[$(date -d "$*" +%s)-$(date +%s)] echo -n $seconds if (( seconds <= 0 )) { (( beep )) && beep || echo -ne "\a" } sleep 1 echo -ne "\r\e[2K" done