Skip to content

Instantly share code, notes, and snippets.

@naus3a
Created November 5, 2020 18:05
Show Gist options
  • Save naus3a/5f337e7d6bf9c18a5a745809cac2b0ea to your computer and use it in GitHub Desktop.
Save naus3a/5f337e7d6bf9c18a5a745809cac2b0ea to your computer and use it in GitHub Desktop.
bash Conway glider spinner
#!/bin/bash
frames=("⠢⠇" "⠨⠖" "⠬⠆" "⠐⡴" "⠢⠇" "⠨⠖" "⠬⠆" ".." "⣤ ")
nFrames=${#frames[@]}
curFrame=0
frameTime=0.2
printf " "
while true; do
printf "\033[2D${frames[$curFrame]}"
curFrame=$[$curFrame+1]
if [ $curFrame -ge $nFrames ]; then
curFrame=0
fi
sleep $frameTime
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment