Skip to content

Instantly share code, notes, and snippets.

@tomfun
Created April 18, 2019 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomfun/4019b58bd1f3c3e5b0b5ed9bc15ae399 to your computer and use it in GitHub Desktop.
Save tomfun/4019b58bd1f3c3e5b0b5ed9bc15ae399 to your computer and use it in GitHub Desktop.
Simple bash status updater - preloader
#!/usr/bin/env bash
i=0
sp='/-\|'
n=${#sp}
STATUS='Created'
while [[ $STATUS == 'InProgress' || $STATUS == 'Created' ]]
do
sleep 1
# replace echo with real command
STATUS=`echo 'InProgress'`
MESSAGE=`date "+[%Y-%m-%d %H:%M:%S][$DEPLOY_ENV] - $STATUS"`
printf '\r%s' "${MESSAGE} ${sp:i++%n:1}"
done
@tomfun
Copy link
Author

tomfun commented Apr 18, 2019

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