'uniq -c' on unsorted input
example data for uniqc
makefile and example script