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!" |
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.
|
Syntax Error
That did the trick. Thank you for the help.
|
All times are GMT -5. The time now is 10:39 AM. |