Created
March 31, 2018 18:28
-
-
Save fabienhinault/fab4944da704e390e3196b82968266f9 to your computer and use it in GitHub Desktop.
generates random digits in 2-9 as you type enter. Useful for practicing multiplication. type any char, then enter and it stops.
This file contains hidden or 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
| while read line | |
| do | |
| if [ -z "$line" ] | |
| then | |
| cat /dev/urandom | tr -dc '2-9' | head -c 1 | |
| else | |
| break | |
| fi | |
| done < /dev/tty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment