Unless I am mistaken, you want a == in your if statement, not a single =.
Code:
#!/bin/bash
echo -n "What is your last name?>"
read text
echo -n "Are you male or female?>"
read sex
if [ $sex == "male" ]; then
echo "Hello Mr. $text"
else
echo "Hello Ms. $text"
fi
edit: and you need
square brackets around an if statement.
edit2: it seems I am mistaken, a single = works fine. Every day's a school day