Skip to content

Instantly share code, notes, and snippets.

@nickolasburr
Created December 1, 2017 21:23
Show Gist options
  • Save nickolasburr/f12148ad7d37d2f54816620a3ad19c7c to your computer and use it in GitHub Desktop.
Save nickolasburr/f12148ad7d37d2f54816620a3ad19c7c to your computer and use it in GitHub Desktop.
Generate pseudo-random alphanumeric string of n characters.
#!/usr/bin/env bash
###
### alphanum: Generate pseudo-random alphanumeric string of n characters.
###
LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c $1 | xargs ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment