1. Use sed to add "1<tab>" (that's a one digit and a tab char) to the first list to difference by and save as "prefix.txt".
2. Use cat to combine all the lists, sort | uniq -c | sort -n | sed <reformat to make tab delimited> | sort again and save as output.txt.
3. join prefix.txt and output.txt on each whole line and cut the second tab delimited field to produce the final result.
So in order to be in the result, a list item must appear in exactly one list and that must be the first list. That should be what we want (?)
1. Use sed to add "1<tab>" (that's a one digit and a tab char) to the first list to difference by and save as "prefix.txt".
2. Use cat to combine all the lists, sort | uniq -c | sort -n | sed <reformat to make tab delimited> | sort again and save as output.txt.
3. join prefix.txt and output.txt on each whole line and cut the second tab delimited field to produce the final result.
So in order to be in the result, a list item must appear in exactly one list and that must be the first list. That should be what we want (?)