From 1bed95ddd1bcc0d158754db0eb704baa1a83b576 Mon Sep 17 00:00:00 2001 From: nicholas Date: Tue, 4 Sep 2018 14:20:01 -0400 Subject: [PATCH] Fix line 48 typo, retab. --- passphrase | 66 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/passphrase b/passphrase index f92b912..6fedf3b 100755 --- a/passphrase +++ b/passphrase @@ -13,21 +13,21 @@ echo "" while [[ $# > 0 ]]; do # iterate through arguments, one or two steps at a time - key="$1" # argument key - - case $key in - -s) # we want spaces b/w words - SPACE=1 - # since this option takes no value argument, we only want - # to shift ahead one argument - ;; + key="$1" # argument key - -c) # we want a certain number of groups - COUNT="$2" - # and since this does have a value, skip the value itself on - # the next scan... we know it's not an argument key - shift - ;; + case $key in + -s) # we want spaces b/w words + SPACE=1 + # since this option takes no value argument, we only want + # to shift ahead one argument + ;; + + -c) # we want a certain number of groups + COUNT="$2" + # and since this does have a value, skip the value itself on + # the next scan... we know it's not an argument key + shift + ;; -w) # we are specifying a word count WORDS="$2" @@ -35,40 +35,40 @@ while [[ $# > 0 ]]; do # iterate through arguments, one or two steps at a time shift ;; - *) - # we were given an argument we don't understand or don't care - # about. Let's just... ignore it completely, shall we? - ;; - esac + *) + # we were given an argument we don't understand or don't care + # about. Let's just... ignore it completely, shall we? + ;; + esac - shift # shift ahead one (more) argument + shift # shift ahead one (more) argument done -if [ "$COUNT" -lt 1 ] || [ "$WORDS" -t 1 ] ; then +if [ "$COUNT" -lt 1 ] || [ "$WORDS" -lt 1 ]; then - echo -e "Don't be cheeky.\n" + echo -e "Don't be cheeky.\n" fi for (( z = 1; z <= $COUNT; z++ )); do # give us COUNT groupings of five passphrases - for i in {1..5}; do + for i in {1..5}; do - PASSPHRASE=`grep "^[a-z]\{3,8\}$" /usr/share/dict/words | shuf -n$WORDS` - # select all words from the standard linux words file with a length between - # 3 and 8 characters. Give us some of those words at random. + PASSPHRASE=`grep "^[a-z]\{3,8\}$" /usr/share/dict/words | shuf -n$WORDS` + # select all words from the standard linux words file with a length between + # 3 and 8 characters. Give us some of those words at random. - if [ "$SPACE" -eq 0 ]; then # if we want spaces stripped + if [ "$SPACE" -eq 0 ]; then # if we want spaces stripped - PASSPHRASE=`echo $PASSPHRASE | tr -d '[[:space:]]'` # trim all spaces - - fi + PASSPHRASE=`echo $PASSPHRASE | tr -d '[[:space:]]'` # trim all spaces - echo $PASSPHRASE # dump result to screen + fi - done + echo $PASSPHRASE # dump result to screen - echo "" + done + + echo "" done