Skip to content

Instantly share code, notes, and snippets.

@cmndrsp0ck
Created January 7, 2023 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmndrsp0ck/bda29a918e5b38cc6273e18da7ea29a9 to your computer and use it in GitHub Desktop.
Save cmndrsp0ck/bda29a918e5b38cc6273e18da7ea29a9 to your computer and use it in GitHub Desktop.
Generate variable length password in cli
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