Hey, I'm making a little program that asks you your name last name age and gender.
It works great up until it asks me my gender so i say "male" and it says something went wrong. here is the porgram actually running:
Code:
Enter your first name:
Rafael
Hello,Rafael, what is your last name?
Lopez
So your full name is Rafael Lopez? Great, Now how old are you?
13
Are you male or female?
male
./mysecond~: line 20: syntax error: unexpected end of file
[rafael@localhost Desktop]$
oh bummer.
and here is what I made
Code:
#!/bin/bash
clear
echo " "
echo "Enter your first name:"
read FirstName
echo "Hello,"$FirstName", what is your last name?"
read LastName
echo "So your full name is "$FirstName" "$LastName"? Great, Now how old are you?"
read age
echo "Are you male or female?"
read gender
if "male"
then
echo "Mr. "$LastName" is "$age" years old. Cool. Bye!"
if "female"
then
echo "Mrs. "$LastName" is "$age" years old. Cool. Bye!"
exit
what am I doing wrong?
I have also tried no putting echoes in the "if male/female then ..." but nothing changes.
Help please?