I have a file fruits:
ap ple
ora nge
pe ar
gra pes
bro ccoli
tom ato
ap ache
I'd like to make an awk script to check how many fruits are there in the file.
I have tried
awk -F: '/ap|ora|pe|gra ple|nge|ar|pes/ {sum+=1} END {print sum+0}' fruits
and it should return 4, since 4 of their pairs are exact match, but they're returning 5 I think due to ap ache. Does the space not register in this case?