Created
March 11, 2023 12:10
-
-
Save sween/99a4ef5e17a82bec9cc27a319cb9dcb9 to your computer and use it in GitHub Desktop.
spinner.sh
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/scp [email protected]:file somewhere 2>/dev/null & | |
pid=$! # Process Id of the previous running command | |
spin[0]="-" | |
spin[1]="\\" | |
spin[2]="|" | |
spin[3]="/" | |
echo -n "[copying] ${spin[0]}" | |
while [ kill -0 $pid ] | |
do | |
for i in "${spin[@]}" | |
do | |
echo -ne "\b$i" | |
sleep 0.1 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment