Skip to content

Instantly share code, notes, and snippets.

@yogurt1 yogurt1/pwgen.sh
Last active May 14, 2018

Embed
What would you like to do?
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
@damianb

This comment has been minimized.

Copy link

damianb commented May 14, 2018

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
You can’t perform that action at this time.