File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,15 @@ random_punctuation() {
4747
4848}
4949
50+ capitalize_word() {
51+ echo $(tr '[:lower:]' '[:upper:]' <<< ${1:0:1})${1:1}
52+ }
53+
5054generate_random_password() {
5155 local word1
5256 local word2
57+ local word1_capitalized
58+ local word2_capitalized
5359 local punctuation
5460 local digit
5561 local local_result
@@ -62,13 +68,15 @@ generate_random_password() {
6268 random_line_from_file base_compound_nouns.txt
6369 word1=$(echo "${RANDOM_LINE_RESULT}" | egrep --only-matching '^\w+')
6470 word2=$(echo "${RANDOM_LINE_RESULT}" | egrep --only-matching '\w+$')
71+ word1_capitalized=$(capitalize_word $word1)
72+ word2_capitalized=$(capitalize_word $word2)
6573
6674 random_punctuation
6775 punctuation="${PUNCTUATION_RESULT}"
6876
6977 digit=$(jot -r 1 0 9)
7078
71- local_result="${word1 }${digit}${punctuation}${word2 }"
79+ local_result="${word1_capitalized }${digit}${punctuation}${word2_capitalized }"
7280
7381 done
7482 RANDOM_PASSWORD_RESULT="${local_result}"
You can’t perform that action at this time.
0 commit comments