Skip to content

Instantly share code, notes, and snippets.

@leoh0
Forked from whitekid/genpass.sh
Created April 14, 2014 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoh0/10622448 to your computer and use it in GitHub Desktop.
Save leoh0/10622448 to your computer and use it in GitHub Desktop.
#!/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