Skip to content

Instantly share code, notes, and snippets.

@cjus
Last active March 29, 2018 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjus/31d963ed5dc013f31670d3042ee88ed1 to your computer and use it in GitHub Desktop.
Save cjus/31d963ed5dc013f31670d3042ee88ed1 to your computer and use it in GitHub Desktop.
Shell based countdown timer
#!/bin/bash
COUNTER=$1
while [ $COUNTER -gt 1 ]; do
let COUNTER=COUNTER-1
echo -ne "Seconds remaining: $COUNTER\033[0K\r"
sleep 1
done
echo -ne "\033[0K\r"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment