Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Created March 31, 2018 18:28
Show Gist options
  • Save fabienhinault/fab4944da704e390e3196b82968266f9 to your computer and use it in GitHub Desktop.
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.
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