Advertisement
Guest User

Untitled

a guest
Apr 20th, 2020
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. # If you want to show 123 / 524 just call it like so :
  2. # progress_bar 123 524 SomeComment
  3. progress_bar(){
  4.  
  5. VAL=$1
  6. OUTOF=$2
  7. LOG=$3
  8. BAR="#####################################################"
  9. END=" |"
  10. BAR_LEN="${#BAR}"
  11. PROP=$(($VAL*$BAR_LEN/$OUTOF))
  12. echo -ne "\r${BAR:0:$PROP}${END:$PROP+1:${#END}} $VAL/$OUTOF $LOG"
  13. if [ $VAL = $OUTOF ]
  14. then
  15. echo Done!
  16. fi
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement