-   Linux - General (
-   -   syntax error near unexpected token (

deskjockey39 01-14-2007 11: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" ]
echo "User chose Yes"
echo "User chose No"

case "$choice" in
echo "Y chosen"
echo "N chosen"
echo "You are leaving the lair!"

blackhole54 01-15-2007 05: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 09:47 AM

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

All times are GMT -5. The time now is 06:28 PM.