Skip to content

Instantly share code, notes, and snippets.

@whitekid
Created March 26, 2014 06:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save whitekid/9777588 to your computer and use it in GitHub Desktop.
Save whitekid/9777588 to your computer and use it in GitHub Desktop.
Random Password Generator
#!/bin/sh
genpasswd() {
local l=$1
[ "$l" == "" ] && l=16
cat /dev/urandom | LC_CTYPE=C tr -dc A-Za-z0-9_ | head -c ${l}
echo
}
genpasswd "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment