Help with read/if command.

M

Malohhree

Guest
What is wrong with this?

#!/bin/bash

echo "Who are you?"
read NAMES
if [ "$NAMES" == "Palmer" ] ; then
echo "Oh, hey! I love you, baby!"
elif [ "$NAMES" == "Mallory" ] ; then
echo "Hello, me!"


When I run it, it asks me who I am, to which I reply with either Mallory or Palmer. Then it says "line 9: syntax error: unexpected end of file"
 


you didn't end the if.
Code:
#!/bin/bash

echo "Who are you?"
read NAMES
if [ "$NAMES" == "Palmer" ] ; then
echo "Oh, hey! I love you, baby!"
elif [ "$NAMES" == "Mallory" ] ; then
echo "Hello, me!"
fi;
 


Top