LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   syntax error near unexpected token (https://www.linuxquestions.org/questions/linux-general-1/syntax-error-near-unexpected-token-519199/)

deskjockey39 01-14-2007 10:56 AM

syntax error near unexpected token
 
I am brand new at scripting and am having some trouble with syntax errors. I am trying to run a simple script game but get the follwing error: syntax error near unexpected token 'Y>'

Here is script, any help or advice is appreciated.

echo "You have entered the world of the Dragon Slayer"
echo " Do you wish to continue?"
read choice
if [ $choice = "Y" ]
then
echo "User chose Yes"
else
echo "User chose No"
fi

case "$choice" in
Y>
echo "Y chosen"
./dragonslayer1
;;
N>
echo "N chosen"
./dragonslayer2
;;
exit>
echo "You are leaving the lair!"

blackhole54 01-15-2007 04:50 AM

In your case statement, each choice should be followed by a right parenthesis, not an angle bracket (greater than sign). You have also forgotten to end your case statement with an esac.

deskjockey39 01-16-2007 08:47 AM

Syntax Error
 
That did the trick. Thank you for the help.


All times are GMT -5. The time now is 10:39 AM.