Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Using Unix sort

by Rhose (Priest)
on Aug 31, 2001 at 22:35 UTC ( #109481=note: print w/replies, xml ) Need Help??


in reply to sorting /etc/hosts

As posted above, I would use the Unix sort -- fields are delimited with a dot, and you want to numerically sort on the 4th field.
sort -t. +3n /etc/hosts
Does that work for you?

Replies are listed 'Best First'.
Re: Using Unix sort
by tmbailey123 (Initiate) on Aug 31, 2001 at 23:14 UTC
    excuse me I replied to the wrong reply. yes

    sort -t +3n /etc/hosts

    works !

    thx again

    -mike

Re: Using Unix sort
by tmbailey123 (Initiate) on Aug 31, 2001 at 23:07 UTC
    Yes, I tried a sort -n but, here is a snippet of my output.

    <code> 10.194.196.10 romulus
    10.194.196.100 nnocws014
    10.194.196.101 wslkms01 wslknms01
    10.194.196.102 nnocws016
    10.194.196.103 nnocws017
    10.194.196.104 txwl008w
    10.194.196.105 nnocws019
    10.194.196.106 txwl015w
    10.194.196.11 otter
    10.194.196.110 nnocweb01
    10.194.196.111 shemp
    10.194.196.113 dvwl000s
    10.194.196.125 spanky
    10.194.196.126 buckwheat
    10.194.196.127 datapro
    10.194.196.128 darla
    10.194.196.129 txwl018w
    10.194.196.13 nnocdev01
    <code>

    this is not what we are looking for.

    kind regards

    -mike

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://109481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2019-08-21 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?