home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.misc
- Path: sparky!uunet!noc.near.net!bolling.proteon.com!gpr
- From: gpr@proteon.com (Gary Richardson)
- Subject: Trying to "sort" a hosttable
- Message-ID: <C1823z.7r7@proteon.com>
- Keywords: Ain't as easy as I thought...
- Organization: Proteon Inc.
- Date: Thu, 21 Jan 1993 20:55:07 GMT
- Lines: 66
-
-
- Hi all,
-
- Our /etc/hosts table on our DNS host is in alphabetical order
- by hostname. I want to put it in ip address numerical order.
- I've read the man page on sort back and forth, but still can't
- get the damn thing right. When i run the command:
-
- sort -t. +2n -3.3n hosts
-
-
- I get output like this:
-
- 127.0.0.1 localhost loghost
- 128.185.1.2 chaplin.proteon.com chaplin
- 128.185.1.22 c-room.proteon.com c-room
- 128.185.1.3 wcfields.proteon.com wcfields
- 128.185.1.6 laurel.proteon.com laurel
- 128.185.2.22 c-room.proteon.com c-room
- 128.185.2.31 relay1.proteon.com relay1
- 128.185.2.48 relay.proteon.com relay
- 128.185.2.7 frelay.proteon.com frelay
- 128.185.3.1 frelay.proteon.com frelay
- 128.185.3.2 federal.proteon.com federal
- 128.185.3.5 atlanta.proteon.com atlanta
- 128.185.3.6 houston.proteon.com houston
- 128.185.4.1 frelay.proteon.com frelay
- 128.185.4.2 nottingham.proteon.com nottingham
- 128.185.5.18 slime-sync.proteon.com slime-sync
- 128.185.11.100 dhb.pc.proteon.com dhb
- 128.185.11.101 mmg.pc.proteon.com mmg
- 128.185.11.103 gpr.pc.proteon.com gpr
- 128.185.11.108 hs.pc.proteon.com hs
- 128.185.11.109 doc.pc.proteon.com doc
- 128.185.11.110 pc.pc.proteon.com pc
- 128.185.11.111 syb.pc.proteon.com syb
- 128.185.11.144 nks.pc.proteon.com nks
- 128.185.11.166 mah.pc.proteon.com mah
- 128.185.11.2 chaplin.proteon.com chaplin
- 128.185.11.202 tje.pc.proteon.com tje
- 128.185.11.48 fmf.pc.proteon.com fmf
- 128.185.11.5 janis.proteon.com janis
- 128.185.11.50 xxx.pc.proteon.com xxx
- ...
-
- The subnet (third section) sorts fine, but the hostnumber is sorting
- like they're characters and not numbers, even though I'm using the
- "n".
-
- Does anyone know the command I need to use to get my host table
- in a true and complete numerical order?
-
-
- Please respond via email... I don't get the chance to read news
- all that often.
-
- Thanks!! I'll summarize!
-
- -Gary
-
-
- --
- ____ ___ ____ ____ ____ ____ WHO: Gary Richardson
- /___/ /__/ / / / /__ / / /| / HOW: gpr@proteon.com
- / / | /___/ / /____ /___/ / |/ INC. WHAT: Unix Systems Admin
- ___________ 9 Technology Dr, Westboro, Ma 01581__________________________
-