Skip to content

Instantly share code, notes, and snippets.

@ecapuano
Created May 16, 2016 02:25
Show Gist options
  • Save ecapuano/9476c548b8a8b9600ece17da3d522ceb to your computer and use it in GitHub Desktop.
Save ecapuano/9476c548b8a8b9600ece17da3d522ceb to your computer and use it in GitHub Desktop.
Generate N random
# character set to use for generating passwords
chars=abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%
# how many passwords to generate
count=100
n=0
while [ $n -le $count ] ; do
for i in {1..12} ; do #### 12 defines the max size of the passwords
echo -n ${chars:RANDOM%${#chars}:1}
done
((n++))
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment