Created
July 26, 2024 17:28
-
-
Save bmritz/6a5387fdd64b8b5255495cd51da7d7c6 to your computer and use it in GitHub Desktop.
generate_passphrase.sh
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 | |
# Default number of words | |
NUM_WORDS=${1:-4} | |
# Generate a passphrase with a variable number of easily understood words separated by hyphens | |
shuf -n "$NUM_WORDS" /usr/share/dict/words | tr '\n' '-' | sed 's/-$//' | sed 's/$/\n/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment