Created
October 24, 2012 15:31
-
-
Save jonas/3946762 to your computer and use it in GitHub Desktop.
Show progress spinner based on chatty commands
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
# Usage: | |
# progresstinate "Building $SERVER_WAR" \ | |
# mvn clean install | |
progresstinate() { | |
msg="$1"; shift; args="$@"; symbol="-" | |
printf "$msg [$symbol]" | |
"$@" | while read line; do | |
symbol="$(echo "$symbol" | tr -- '-/|\\' '/|\\-')" | |
printf "\b\b$symbol]" | |
done | |
printf "\b\bDONE]\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment