Created
June 27, 2019 12:58
-
-
Save nexus166/dd7ac7a44c6e2efa57122a19650fce73 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| set -e +vx | |
| _WORD=$(shuf -n1 "${WORDLIST:-/usr/share/dict/words}" 2>/dev/null | tr -cd "[[:alpha:]]"); | |
| [[ -z "${_WORD}" ]] && _WORD="$(tr -cd '[:alpha:]' < /dev/urandom | fold -w10 | head -1)" | |
| case "${1}" in | |
| *h) echo -e "Usage:\\t$(basename $0) (-u|-U|-l)";; | |
| *u) echo "${_WORD^}";; | |
| *U) echo "${_WORD}" | tr '[[:lower:]]' '[[:upper:]]';; | |
| *l) echo "${_WORD}" | tr '[[:upper:]]' '[[:lower:]]';; | |
| "") echo "${_WORD}";; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment