Guest User

CTaM w/color

a guest
Apr 27th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Count to one million script with text coloring (for forum games)
  3. # This script requires a program called 'xsel' to
  4. # copy the text to the X clipboard.
  5.  
  6. # This script is contributed to the public domain with CC0.
  7. # See https://creativecommons.org/publicdomain/zero/1.0/legalcode for more info.
  8.  
  9. # Checks if command line options are missing.
  10. if [[ $1 = "" ]]; then
  11.     echo "Usage: `basename $0` [NUMBER]..."
  12.     exit 1;
  13. fi
  14.  
  15. let "NUMBER = $1"
  16. QUITHANDLER=0
  17. END=1
  18.  
  19. while [[ $QUITHANDLER -lt $END ]]
  20. do
  21. let "REMAINING = 1000000 - $NUMBER"
  22. echo "[color=#$NUMBER]$NUMBER[/color]
  23.  
  24. (Only $REMAINING to go!)"  | xsel -b -i
  25.  
  26. echo "Copied to clipboard ($NUMBER) Press enter to repeat.
  27. Type any number greater than 0 to quit."
  28.  
  29. read QUITHANDLER
  30. let "NUMBER++"
  31. done
Advertisement
Add Comment
Please, Sign In to add comment