Syntax Error: Unexpected End of File
I'm trying to write a bash script that takes three positive integers and lets you know what kind of triangle they'd make. However, I keep getting the "syntax error: unexpected end of file" message. Or, if I try to change my script, I have to fix another problem and then come back to the same syntax error.
This is my script:
#! /bin/bash -x
if [[ $# -gt 3 ]]
then
echo "A triangle only has three sides."
fi
elif [[ $# -lt 3 ]]
then
echo "A triangle has more sides than that - try three."
fi
elif [[ $# -eq 3 ]]
while [[ $1+$2<=$3 || $1+$3<=$2 || $2+$3<=$1 ]]
do
echo "These lengths can't be made into a triangle
Who do you think I am, Pythagorus? Try another three positive integers."
done
while [[ $1+$2>$3 && $1+$3>$2 && $2+$3>$1 ]]
while [[ $1*$1+$2*$2=$3*$3 || $1*$1+$3*$3=$2*$3 || $1*$1+$3*$3=$2*$2 ]]
do
echo "This is right triangle. Not right as in 'correct,' as in 'the legs make a 90 degree angle.'"
done
while [[ $1!=$2 && $2!=$3 ]]
do
echo "This is a scalene triangle."
done
while [[ $1=$2 || $1=%3 || $2=$3 ]]
do
echo "This is an isosceles triangle."
done
while [[ $1=$2 && $2=$3 ]]
do
echo "This is an equilateral triangle."
done
if [[ $1<1 ]]
then
echo "Hey, that first length isn't a positive integer."
fi
if [[ $1<1 ]]
then
echo "Hey, that second length isn't a positive integer."
fi
if [[ $1<1 ]]
then
echo "Hey, that third length isn't a positive integer."
fi
I've worked on this for so long, and even if I fix the syntax error I'm afraid I'll just run into more problems. Could anyone help me try to get this script up and running?
Thanks.