From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: [OT] Question about duplicate lines in file
Date: Tue, 13 Jun 2006 00:23:57 +0100 [thread overview]
Message-ID: <20060613002357.2e01866a@hactar.digimed.co.uk> (raw)
In-Reply-To: <448DF025.4010600@vista-express.com>
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2006-06-12 23:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-12 16:42 [gentoo-user] [OT] Question about duplicate lines in file Teresa and Dale
2006-06-12 16:54 ` Raymond Lewis Rebbeck
2006-06-12 17:19 ` Teresa and Dale
2006-06-12 17:32 ` Matthew Cline
2006-06-12 17:37 ` Raymond Lewis Rebbeck
2006-06-12 17:37 ` Neil Bothwick
2006-06-12 17:45 ` Mike Williams
2006-06-12 17:55 ` [gentoo-user] " Christer Ekholm
2006-06-12 18:39 ` Alan McKinnon
2006-06-12 19:15 ` Neil Bothwick
2006-06-12 22:52 ` Teresa and Dale
2006-06-12 23:23 ` Neil Bothwick [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060613002357.2e01866a@hactar.digimed.co.uk \
--to=neil@digimed.co.uk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox