Created
June 9, 2024 11:29
-
-
Save dedlim/79b2ac9fe3d627cd2a0dea7f9ae0f8db to your computer and use it in GitHub Desktop.
Genpass, a password generator in Bourne shell
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/sh | |
case "$1" in | |
-2) RANGE=[:alnum:]; NUM=16;; | |
-3) RANGE=[:digit:]; NUM=16;; | |
*) RANGE=[:lower:]; NUM=8;; | |
esac | |
cat /dev/urandom | tr -cd $RANGE | head -c $NUM; echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment