Created
September 22, 2015 17:13
-
-
Save thiagozs/6834085d271d10d3ffb4 to your computer and use it in GitHub Desktop.
Password Generator Bash
This file contains hidden or 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 | |
| genpasswd() { | |
| local l=$1 | |
| [ "$l" == "" ] && l=16 | |
| tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs | |
| } | |
| genpasswd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment