Even better in bash and ksh you might use the
extended test command, with double square brackets. Among other advantages, it prevents logic errors when the value of the variable is
null and you missed the double quotes around it. Example:
Code:
if [[ $answer == yes ]]
then
echo something
fi
For a discussion about the extended test command, you can take a look at the Advanced Bash Scripting Guide,
here.