Last active
March 25, 2019 11:00
-
-
Save anonur/530af90b8bdccfd4e3756f596884f6be to your computer and use it in GitHub Desktop.
Counting to the given number until it sleeps.
This file contains hidden or 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 | |
#Filename:sleep.sh | |
echo -n Count: | |
tput sc #Store the cursor position. | |
count=0; | |
while true; | |
do | |
if [ $count -lt 40 ] ; | |
then | |
let count++; | |
sleep 1; | |
tput rc #The cursor is restored. | |
tput ed | |
echo -n $count; | |
else exit 0; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment