[Trisquel-users] Re : Sort and Uniq fail to remove all duplicates from a list of hostnames and their IPv4 addresses

lcerf at dcc.ufmg.br lcerf at dcc.ufmg.br
Fri Feb 15 11:56:16 CET 2019


'sort -u' does remove all duplicates.  What you consider duplicates in its  
output must differ in some subtle way, e.g., an additional space at the end  
of the line.  Those differences can be ironed out.  For instance, that  
command "squeezes" the spaces (only leaves one if there are more) in "file",  
removes those at the end of the lines (if any), sort and removes duplicates:
tr -s ' ' < file | sed 's/ $//' | sort -u
LibreOffice Calc is to make calculations.  It is not a database management  
system.


More information about the Trisquel-users mailing list