Skip to content

Instantly share code, notes, and snippets.

@toshi0383
Last active April 9, 2017 04:20
Show Gist options
  • Save toshi0383/32728879049e95db41ab801b1f055009 to your computer and use it in GitHub Desktop.
Save toshi0383/32728879049e95db41ab801b1f055009 to your computer and use it in GitHub Desktop.
Generate random alphanumeric on bash on Mac
#!/bin/bash
# SeeAlso: http://unix.stackexchange.com/questions/45404/why-cant-tr-read-from-dev-urandom-on-osx
LC_CTYPE=C tr -dc 'A-Z0-9' < /dev/urandom | head -c 32 | xargs echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment