Let's say I have a text file:
>>cat tmp.txt
1 1 1 1 1 -1 -1 -1 -1 -1 10 10 10 10 10
I want to find the number of unique occurrences of the number 1, -1, and 10. The following is what I have thus far:
awk -F '-1' '{print NF-1,NR}' tmp.txt | awk '{print $1}'
awk -F '10' '{print NF-1,NR}' tmp.txt | awk '{print $1}'
awk -F '1' '{print NF-1,NR}' tmp.txt | awk '{print $1}'
Where the output is 5, 5, and 15 instead of 5, 5, and 5. It appears the awk command is finding every instance of 1 for the final command. How can this be handled properly?