Last active
May 14, 2018 17:39
-
-
Save yogurt1/305652a47722f7ab1e280ca3828e76c8 to your computer and use it in GitHub Desktop.
pwgen bash edition
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
# How to use: sh pwgen.sh <password length, default 9> | |
_LENGTH=9 | |
if test x"$@" != x | |
then _LENGTH="$@" | |
fi | |
cat /dev/urandom |\ | |
tr -dc 'A-Za-z0-9' |\ | |
fold -w $_LENGTH |\ | |
#-w 20 |\ | |
#colrm $_LENGTH |\ | |
# grep '^[a-zA-Z][a-zA-Z]' |\ | |
head -n10 |\ | |
sed -n \ | |
`echo $RANDOM | colrm 2`p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any chance of a license being declared for this?
MIT? Public domain? Something?