Skip to content

Instantly share code, notes, and snippets.

@anonur
Last active March 25, 2019 11:00
Show Gist options
  • Save anonur/530af90b8bdccfd4e3756f596884f6be to your computer and use it in GitHub Desktop.
Save anonur/530af90b8bdccfd4e3756f596884f6be to your computer and use it in GitHub Desktop.
Counting to the given number until it sleeps.
#!/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