Created
December 4, 2019 05:55
-
-
Save jmcker/778459d40c027dfaf001506a35203da9 to your computer and use it in GitHub Desktop.
Simple bash spinner
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
function spin-wait() { | |
spin="/-\|" | |
echo -n "${1:-Press any key to continue...} " | |
while true | |
do | |
printf "\b${spin:i++%${#spin}:1}" | |
read -n 1 -t 0.25 noop | |
if [ "${?}" == "0" ]; then | |
break | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment