6 declare -a group_questions
11 while read -u 3 line; do
15 # go through each character of line
16 if [ "$line" == "" ]; then
18 for key in "${!questions[@]}"; do
19 question_string+="${key}"
21 group_questions+=($question_string)
26 for (( a=0; a<${#line}; a++ )); do
28 questions["$question"]=1
32 # last line was hit, so we need to process that too
34 for key in "${!questions[@]}"; do
35 question_string+="${key}"
37 group_questions+=($question_string)
44 for group in "${group_questions[@]}"; do
45 sum_of_groups=$((sum_of_groups+${#group}))
48 echo "Sum of groups: $sum_of_groups"