So, I have a file with dozens of lines like this 12 13 59 2 102 12 32 2 99 13 102 19
I need to compare if any of the numbers in first line are present in the second line. Then I need to compare if any of the numbers of the second line are in the third. And so on and so on. I don't want to count if the same number appears in both first and third line (13 for example is not to be counted in my example above). Position is not important (number 12 is in first position in the first line, but second position in the second line, I still want to count it).
I have been looking at ways to do loops but not sure how to build an array for this (not even sure if an array IS the best option).
Any help is greatly appreciated, I usually do well with bash but this time around it's proving more difficult. Thanks!
