line 85: unexpected EOF while looking for matching `"'

hello everyone...im having this problem with unexpected EOF with line 85 which is..i cant see whats wrong with it..can any1 plz help me out.
read -p "$p1 please enter the number of tries you wish to have:" lifeline

function main()
{
guessnum=0
read -p "Please enter if its sinle player game or double player game 1 OR 2:" p3
if [ $p3=2 ]
then
read -p "Player1 please enter your name:" p1
read -p "$p1 please enter your secret word:" hiddword
read -p "$p1 please enter the number of tries you wish to allow:" lifeline
read -p "Player2 please enter your name:" p2
echo "Your word is $($hiddword | wc -c) characters long and you have $lifeline tries to guess it !"
cat $hiddword > hidd
hidden=$(sed -e s'/[A-Za-z]/-/g' hidd)
read -p "$p2: Please enter the guess letter:" guess
elif [ $p3=1 ]
then
read -p "Player1 please enter your name:" p1
read -p "$p1 please enter the number of tries you wish to have:" lifeline
$p2=$p1
hiddword=$(getword)
cat $hiddword > hidd
hidden=$(sed -e s'/[A-Za-z]/-/g' hidd)
else
echo Only two Players can play Please press 1 or 2
fi
check
}
main---------------line 98
-------------------line 99

im also having an error "line 99: syntax error: unexpected end of file
".....while line number 99 is the line shown above and its EMPTY with no code at all.

Thanks

function main()
{
guessnum=0
read -p "Please enter if its sinle player game or double player game 1 OR 2:" p3
if [ $p3=2 ]
then
read -p "Player1 please enter your name:" p1
read -p "$p1 please enter your secret word:" hiddword
read -p "$p1 please enter the number of tries you wish to allow:" lifeline
read -p "Player2 please enter your name:" p2
echo "Your word is $($hiddword | wc -c) characters long and you have $lifeline tries to guess it !"
cat $hiddword > hidd
hidden=$(sed -e s'/[A-Za-z]/-/g' hidd)
read -p "$p2: Please enter the guess letter:" guess
elif [ $p3=1 ]
then
read -p "Player1 please enter your name:" p1
read -p "$p1 please enter the number of tries you wish to have:" lifeline
$p2=$p1
hiddword=$(getword)
cat $hiddword > hidd
hidden=$(sed -e s'/[A-Za-z]/-/g' hidd)
else
echo Only two Players can play Please press 1 or 2
fi
check
}

Hi.

Please use code tags. :slight_smile:

Double check line 15 and 24 'sed' syntax. It may be right, but I've never seen it used that way... I think that may be where your problem is.

Thanks for the reply mate.
I tested the sed lines and they are giving me exactly the results i want.All its doing is, replacing all the characters in a word to "-----"...
The error is...

: line 85: unexpected EOF while looking for matching `"'.....which is this line
read -p "$p1 please enter the number of tries you wish to have:" lifeline
: line 96: syntax error: unexpected end of file.....which is the last line after main

You could have an open backtick (`) statement earlier in the code (or earlier in the logic).

Without seeing all of the code, it's difficult to know for certain.

Heres all my code mate....Thanx for the help

I think I found it:

function main()
{
               guessnum=0
               read -p "Please enter if its single player game or double player game 1 OR 2:" p3
               if [ $p3=2 ]
               then
here ===> read -p Player1 please enter your name:" p1

Thankyou so much mate