Passing values from awk to shell variable

I am writing a script where I need awk to test if two columns are the same and shell to do something if they are or are not.

Here is the code I'm working with:

@ test = 0
...
test = `awk '{if($1!=$2) print 1; else print 0}' time_test.tmp`
#time_test.tmp holds two values separated by a space
echo $test

For some reason, when I run this script it never seems to get to the echo. Is there some other way to pass a value to a script variable? I need test to be 1 if the two values in time_test.tmp are not the same, and 0 if they are.

Thank you.

test=`awk '{if($1!=$2) print 1; else print 0}' time_test.tmp`

echo $test

I think the space around the = creates problems.

test=`awk '{if($1!=$2) print 1; else print 0}' time_test.tmp`

or better, do not use backtics

test=$(awk '{if($1!=$2) print 1; else print 0}' time_test.tmp)

some variation

test=$(awk '{print ($1!=$2)?1:0}' time_test.tmp)

Got it working! I knew it was something like that... Thanks!