Created
January 7, 2023 05:35
-
-
Save cmndrsp0ck/bda29a918e5b38cc6273e18da7ea29a9 to your computer and use it in GitHub Desktop.
Generate variable length password in cli
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
function makePass() { | |
LC_CTYPE=C; | |
local len=${1:-14} | |
local my_pass=$(tr -dc 'A-Za-z0-9_@#%^&*()-+=' < /dev/urandom | head -c ${len}) | |
echo "${my_pass}"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment