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