Fix line 48 typo, retab.
This commit is contained in:
parent
fcbb45905d
commit
1bed95ddd1
66
passphrase
66
passphrase
@ -13,21 +13,21 @@ echo ""
|
|||||||
|
|
||||||
while [[ $# > 0 ]]; do # iterate through arguments, one or two steps at a time
|
while [[ $# > 0 ]]; do # iterate through arguments, one or two steps at a time
|
||||||
|
|
||||||
key="$1" # argument key
|
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
|
|
||||||
;;
|
|
||||||
|
|
||||||
-c) # we want a certain number of groups
|
case $key in
|
||||||
COUNT="$2"
|
-s) # we want spaces b/w words
|
||||||
# and since this does have a value, skip the value itself on
|
SPACE=1
|
||||||
# the next scan... we know it's not an argument key
|
# since this option takes no value argument, we only want
|
||||||
shift
|
# 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
|
-w) # we are specifying a word count
|
||||||
WORDS="$2"
|
WORDS="$2"
|
||||||
@ -35,40 +35,40 @@ while [[ $# > 0 ]]; do # iterate through arguments, one or two steps at a time
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
# we were given an argument we don't understand or don't care
|
# we were given an argument we don't understand or don't care
|
||||||
# about. Let's just... ignore it completely, shall we?
|
# about. Let's just... ignore it completely, shall we?
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
shift # shift ahead one (more) argument
|
shift # shift ahead one (more) argument
|
||||||
|
|
||||||
done
|
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
|
fi
|
||||||
|
|
||||||
for (( z = 1; z <= $COUNT; z++ )); do # give us COUNT groupings of five passphrases
|
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`
|
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
|
# 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.
|
# 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
|
PASSPHRASE=`echo $PASSPHRASE | tr -d '[[:space:]]'` # trim all spaces
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $PASSPHRASE # dump result to screen
|
fi
|
||||||
|
|
||||||
done
|
echo $PASSPHRASE # dump result to screen
|
||||||
|
|
||||||
echo ""
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user