Skip to content

Instantly share code, notes, and snippets.

@jmcker
Created December 4, 2019 05:55
Show Gist options
  • Save jmcker/778459d40c027dfaf001506a35203da9 to your computer and use it in GitHub Desktop.
Save jmcker/778459d40c027dfaf001506a35203da9 to your computer and use it in GitHub Desktop.
Simple bash spinner
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