Last active
December 23, 2021 18:13
-
-
Save mikhdm/6e887b4e273895af4d917b3e214efb1e to your computer and use it in GitHub Desktop.
password generator
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 | |
PATTERN="A-Za-z0-9_" | |
if [ -z "$1" ]; then | |
N=16 | |
else | |
N=$1 | |
fi | |
echo $(cat /dev/urandom | LC_ALL=C tr -cd "$PATTERN" | head -c $N) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment