Last active
March 29, 2018 21:59
-
-
Save cjus/31d963ed5dc013f31670d3042ee88ed1 to your computer and use it in GitHub Desktop.
Shell based countdown timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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