I have a file similar to the following :
x 0
1 x
1 1
and I am essentially trying to see if both fields are equal to one another or not for every row. But the problem is that this file contains x
which can either hold the value of 0
or 1
-- but I am not sure how to set this in awk
I tried working with the following code that did not work, it only works if x
is set to either 0
or 1
, not both.
y=$(seq 1 2)
awk -v x="$y" '{ if ($1==$2) print "good" }' file
Please advise or let me know if any clarification is necessary, thank you.