to compare two strings

hi all,
i am new to unix. Actually i need to compare two string and print the result...

suppose type='sun'
if[$type = 'sun' ]; then
echo good morning
else
echo good night
fi

whether the comparison is right r we need to use eq????

help me please.... :confused:

thanks in advance....

= is used for string comparison.
eq is used for arithmetic comparison.
what you are doing is right