I'm receiving an error saying line 44: syntax error: unexpected end of file
#!/bin/sh touch $results.txt #creates txt file now="$(date)" #records current date and time to be posted echo "Name: Kevin Delrisco" > results.txt echo "Date and time: $now" >> results.txt echo -n "Enter a number between 1-50: " # asks user to enter a number read n while [[$n -le 1 || $n -ge 51 ]] do #while loop to check if number is over 50 echo -n "Enter a number between 1-50: " read n; done sum= 0 for (( i = 1; i<=$n; i++ )) do #for loop to add the sum sum=$(( $sum + $i )); done echo "Sum of numbers is $sum" echo "Sum of numbers is $sum" >> results.txt 11 Answer
read n done This reads two values from the input into $n and $done.
Insert ; or a newline before done to make it close the while loop.