I am working on the last problem in the lab on while loop and getting an error unary operator expected in line 3. Not sure what is wrong with the script. Please help,
Script is as below:
while true
do
echo “1. Add”
echo “2. Subtract”
echo “3. Multiply”
echo “4. Divide”
echo “5. Quit”
read -p "Enter your choice:" choice
read -p "Enter first Number:" Number1
read -p "Enter second number:" Number2
if [ $choice -eq 1]
then
echo Answer=$(( $Number1 + $Number2))
elif [ $choice -eq 2 ]
then
echo Answer=$(($Number1 - $Number2))
elif [ $choice -eq 3 ]
then
echo Answer=$(( $Number1 * $Number2 ))
elif [ $choice -eq 4 ]
then
echo Answer=$(( $Number1 / $Number 2))
elif [ $choice -eq 5 ]
then
break
fi
done