Skip to content

Instantly share code, notes, and snippets.

@cuotos
Created November 16, 2017 12:32
Show Gist options
  • Save cuotos/e800dff478abfbc61276e3bb50354a24 to your computer and use it in GitHub Desktop.
Save cuotos/e800dff478abfbc61276e3bb50354a24 to your computer and use it in GitHub Desktop.
Rotating Cursor
#!/bin/bash
# Written by Locutus for bash demonstration.
rotateCursor()
{
case $toggle
in
1)
echo -n $1" \ "
echo -ne "\r"
toggle="2"
;;
2)
echo -n $1" | "
echo -ne "\r"
toggle="3"
;;
3)
echo -n $1" / "
echo -ne "\r"
toggle="4"
;;
*)
echo -n $1" - "
echo -ne "\r"
toggle="1"
;;
esac
}
while [ 0 ]
do
rotateCursor " Spinning around happily"
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment