Skip to content

Instantly share code, notes, and snippets.

@shiva
Created August 29, 2011 02:55
Show Gist options
  • Save shiva/1177680 to your computer and use it in GitHub Desktop.
Save shiva/1177680 to your computer and use it in GitHub Desktop.
prints a number at the same location in a line until 0 (countdown)
#!/bin/sh -x
# -x prints every command before it executes it
# prints 3, 2, 1, 0 in the same location
echo -n " "
let i=3
while [ ${i} -ge 0 ]
do
printf "\b${i}"
let i-=1
sleep 1
done
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment