I found here on superuser the following nice countdown script that I could include in my .bash_profile:
function countdown(){
date1=$((`date +%s` + $1));
while [ "$date1" -ne `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r";
sleep 0.1
done
}
It doesn't work on OSX, i understand, because of the differences in the date command. Another user commented as such but the problem remained unresolved in that question.
The same problem (I think) is also discussed and solved here but I cannot work out how to modify the countdown script to utilise this solution.