On Mon, 12 Jun 2006 17:52:21 -0500, Teresa and Dale wrote:

> >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.

What's the format of the file? If it's a standard /etc/hosts layout, this
will removed duplicates based on IP address, but if you have another
field first, you need to change the key.


-- 
Neil Bothwick

"Bother," said Pooh, as he connected at 300 bps.

Attachment: signature.asc
Description: PGP signature

Reply via email to