I am new to awk and I was wondering if I could get one single result for an if operation on awk.
Example:
cat example.txt:
0
0
0
0
0
awk '{ if ($1==0) print "all zeros"; else print "there is 1"}'
result:
all zeros
all zeros
all zeros
all zeros
all zeros
I would like to have only one all zeros as answer or a TRUE . Is this the case where I should use an awk function to return something ? Thanks