SO here is a question on my homework:
Write a program to continue taking numbers from the user until he/she enters a null value. When so, the program should show the average value.
So here is the code I used
1 echo "Keep entering numbers until you want to stop"
2 read num
5 while [ -n "$num" ]
7 read num
8 let total=$total+$num
9 let count=$count+1
11 let average=$total%$count
12 echo "The average of all those numbers is "$average
I keep getting a Syntax error on line 8 for some reason... I know its probably a silly newb mistake, but what am I doing wrong here??? Thank you!