Posted by: Saajha August 18, 2009
--Comparing Text Strings--
Login in to Rate this Post:     0       ?        
Thanks @gidilat, for the advice, and welcome to the forum - if you are a new member :-)

Just looked through the commands and spotted a minor gotcha..

When you do sort -u and sort the list in order by unique elements, you'd actually get rid of multiple occurrences of each element. Once that's done, it's really a one to one comparison, no?

In the above scenario, ALL occurrences of def on list A were eliminated - as they matched def on list B.
But if I had, say abc listed twice in list A and did not exist at all in list B, sort -u would remove the second instance of abc in list A, correct? But the goal is to have every single occurrence of abc in list A if it's not present in list B.

Thanks again for chiming in.
~@~
Read Full Discussion Thread for this article