Neil Bothwick wrote:

>On Mon, 12 Jun 2006 20:39:20 +0200, Alan McKinnon wrote:
>
>  
>
>>If /etc/hosts has these lines:
>>127.0.0.1 localhost
>>127.0.0.1  localhost
>>uniq will see these as different even though they are actually the 
>>same entry. So he needs something like tr to squash spaces. This will 
>>do it (as root):
>>
>>cat /etc/hosts | tr -s ' ' | sort | uniq -i > /etc/hosts.new
>>    
>>
>
>sort -u -k1,1 /etc/hosts >/etc/hosts.new
>
>avoids the need to use cat, uniq or tr. -k1,1 sorts on the first field
>(space delimited) and -u remove lines where the sort field is the same.
>
>
>  
>

Well that removed a few, all of them to be exact.  The file was blank. 
O_O  LOL  I'm learning though.

Dale
:-)
-- 
gentoo-user@gentoo.org mailing list

Reply via email to