Last active
June 2, 2022 14:16
-
-
Save smuuf/bf2762e5c431b960d84b659a25af685f to your computer and use it in GitHub Desktop.
Bash sleep with countdown
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 | |
function psleep { | |
S="$1" | |
O="$S" | |
while [ $S -gt 0 ]; do | |
echo -ne "\r$S s (from $O) " | |
sleep 1 | |
((S--)) | |
done | |
echo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment