Skip to content

Instantly share code, notes, and snippets.

@countless-integers
Created May 24, 2016 18:38
Show Gist options
  • Save countless-integers/8f84e41f43baa0e49a8ba73635760916 to your computer and use it in GitHub Desktop.
Save countless-integers/8f84e41f43baa0e49a8ba73635760916 to your computer and use it in GitHub Desktop.
#!/bin/bash
# head -n200 /dev/urandom | cksum :: get output from urand and 'convert' it to dec; not exactly perfect
# sed :: remove anything that's NaN (e.g. spaces)
# head :: make the generated rand number 10 digits long
head -n200 /dev/urandom | cksum | sed -E 's/[^0-9]+//' | head -c 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment