Conflict with the operator in IF

I am using a script like this

source=$1

if [ "$source" == "bof.tmp_rst_tb" ] ; 
then 
  echo "got it"
else 
  echo "lost it"
fi
	       But the script is giving th error like
script.ksh[144]: ==: unknown test operator
	       Can i know , is the syntax iam using is correct or suggest me a good way.

	       Thanks.

What happens if you use of two?

Tested this with a few shells (well bash and ksh) on a couple of OS's (not Solaris).

So, feeling lucky, I'll say you're using Solaris :slight_smile:

YUp it works..
Thanks a lot

The reason it failed is that

if [  expression ]

is the same as:

if test expression

and test(1) does not support the == operator. For that, you need a use a conditional expression as described in ksh(1), which uses "[[":

if [[ expression ]]