Skip to content

Instantly share code, notes, and snippets.

@maishuguang
Created May 9, 2016 08:17
Show Gist options
  • Save maishuguang/e09b106de0a6a53a0f04ece420c5ea68 to your computer and use it in GitHub Desktop.
Save maishuguang/e09b106de0a6a53a0f04ece420c5ea68 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
sym = ['|', '/', '-', '\\']
count = 0
printf "\033[s"
10.times do
printf "\033[u\033[1D"
printf "\033[34m" + sym[count % sym.length] + "\033[0m"
printf "\033[s\033[0;0f"
STDOUT.flush
sleep 1
count += 1
end
printf "\033[u"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment