Skip to main content
1 of 3
jimmy23013
  • 37k
  • 6
  • 77
  • 148

#Bash, 66

LANG=C sed -r '/^-?(0|[1-9][0-9]*)$/q;s/.*/5000000/;q'</dev/random

It almost always prints 5000000. But if it found a valid number in /dev/random, it will print it instead.

jimmy23013
  • 37k
  • 6
  • 77
  • 148