一个错误的IF循环

一个错误的IF循环

echo "do you know now use if construct?(y/n)"
read ans
if [$ans="y"]
then
        echo "good"
else if [$ans="n"]
         echo "you should learn to use if.
         echo "input error""
fi
fi

运行那时总提示第九行出错啊,为什么?我是个初学者啊,看来也没怎么错FI是作为这个循环的语句啊      
什么错误信息?      
line9:..................粗略就是这样啊,我换了登临系统看不到啊,两行也是LINE9的,一会儿放完整的      
echo "do you know now use if construct?(y/n)"
read ans
if [ $ans = "y" ]
then
echo "good"
elif  [ $ans = "n" ]
then
echo "you should learn to use if"
else
echo "input error"
fi