Skip to content

Instantly share code, notes, and snippets.

@yogurt1
Last active May 14, 2018 17:39
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 yogurt1/305652a47722f7ab1e280ca3828e76c8 to your computer and use it in GitHub Desktop.
Save yogurt1/305652a47722f7ab1e280ca3828e76c8 to your computer and use it in GitHub Desktop.
pwgen bash edition
# 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
@katanacrimson
Copy link

Any chance of a license being declared for this?

MIT? Public domain? Something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment