Created
November 19, 2017 21:20
-
-
Save victorfsf/a4f1dcfc6ea7256cf7e73bcae2324caa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
sleep 10 &! | |
pid=$! # Process Id of the previous running command | |
spin='⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓' | |
i=0 | |
while kill -0 $pid 2>/dev/null; do | |
i=$(((i + 1) % 10)) | |
printf "$fg[magenta]\r${spin:$i:1}" | |
printf "$fg[white] Waiting..." | |
sleep .1 | |
done | |
printf "\r$fg[green]✓\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment