Guest User

count to one million script

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