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.