I think this is the best answer. Better to use an existing solution than to program it yourself. You can also use a series of greps or a diff as an alternative to uniq, depending on exactly what you are trying to do. Check out this relevant link.
In reply to Re^2: find unique lines in two files
by Phenomanan
in thread find unique lines in two files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |