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"
 


R

ryanvade

Guest
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;
 

Members online

No members online now.

Latest posts

Top