Skip to content

Instantly share code, notes, and snippets.

@dideler
Last active October 1, 2023 16:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dideler/b0a0ef8b95e683752883 to your computer and use it in GitHub Desktop.
Save dideler/b0a0ef8b95e683752883 to your computer and use it in GitHub Desktop.
Basic CLI loading animation
#!/usr/bin/env bash
for i in {0..12}; do
if ! (($i % 4)); then
printf "\e[1K\rloading"
else
printf "."
fi
sleep 1
done && printf "\e[2K\r"
@mateusza
Copy link

mateusza commented Oct 1, 2023

you don't put $i in (( )). Just i is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment