sort -u does wonders.