This is what I have so far. How could I incorporate count to take the user input each time the loop completes and add them together and create and average of the inputs?
#!/bin/bash
#Variables
lower=1
middle=50
higher=100
notdone=true
while [ $notdone ]; do
#Pick a Number
echo "Please pick a number between 1 and 100: "
read input
#Loop until wiithin range
until [[ $input -ge $lower ]] && [[ $input -le $higher ]]; do
echo "Number not in range.
Please pick a number between 1 and 100: "
read input
done
echo "You picked $input"
if [[ $input -ge $middle ]]; then
echo "Your answer is in the top half"
fi
if [[ $input -le $middle ]]; then
echo "Your answer is in the top half"
fi
done