Created
September 17, 2015 09:33
-
-
Save doertedev/cb03aef47aff9687d78a to your computer and use it in GitHub Desktop.
/dev/urand as a password generator
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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Please provide a length (e.g. \`urandgen 40\`)!"; | |
exit 1; | |
fi | |
# I rather use the whole list of characters and add/remove one by hand then to screw around with a-zA-Z9-9... | |
cat /dev/urandom | tr -dc 'qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM1234567890,.-;:_!@§$%&/()=?`*+' | head -c $1 | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment