Created
December 26, 2016 13:33
-
-
Save etaf/9edd273c0a7ae918896e8fc07a3df65f to your computer and use it in GitHub Desktop.
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
spinner() { | |
local spin="\\|/-" | |
local i=0 | |
tput civis | |
while kill -0 "$1" 2>/dev/null; do | |
i=$(( (i+1) %4 )) | |
printf "\b%s" "${spin:$i:1}" | |
sleep 0.07 | |
done | |
tput cnorm | |
} | |
cmd ... | |
spinner $! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment