I keep getting the following error in my bash script when i attempt to run it, i can’t seem to find the problem. I think it has something to do with how i am closing my loop(s). Any help would be much appreciated
bash: random: line 66: syntax error: unexpected end of file
Below is my code
#!/bin/bash
one=$RANDOM
two=$RANDOM
# Declare variable choice and assign value 4
choice=5
# Print to stdout
echo "1. -l"
echo "2. -m"
echo "3. -c"
echo "4. -i"
echo -n "Please choose a word [1,2,3,4]? "
while [ $choice -eq 5 ]; do
#option -l
if [ $choice -eq 1 ] ; then
#do something
else
echo "Please make a choice between 1 -4 !"
echo "1.-l"
echo "2.-m"
echo "3.-c"
echo "4.-i"
echo -n "Please choose a word [1,2,3 or 4]? "
choice=5
fi
echo"finished"
done
EDIT* Removed bulky code as it was causing an indent problem.
You haven’t done a
donefor your while loop: