Created
February 24, 2017 21:59
-
-
Save NF1198/b71ef58dc8ac3c288b447fbf1680b83a to your computer and use it in GitHub Desktop.
genpasswd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to bashrc | |
#genpasswd <num_chars> | |
# generates a password of the specified length | |
genpasswd() { | |
local l=$1 | |
[ "$l" == "" ] && l=20 | |
tr -dc [:alnum:]\*\&\^\%\$\#\@\_ < /dev/urandom | head -c ${l} | xargs | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment