Re: "sort" problem

cbaker_at_GOODYEAR.COM
Date: 02/26/04

  • Next message: Edson Noboru Yamada: "HACMP question about clsmuxpd and snmp"
    Date:         Thu, 26 Feb 2004 14:26:41 -0500
    To: aix-l@Princeton.EDU
    
    

    sort -t"." -k1,1n -k2,2n -k3,3n -k4,4n

    Christopher M. Baker
    Senior Technical Support Analyst
    DSE/TCO
    Goodyear Tire and Rubber Company

    =================================================
    Contains Confidential and/or Proprietary Information.
    May not be copied or disseminated without the expressed
    written consent of The Goodyear Tire & Rubber Company.
    =================================================

                          Denny Watkins
                          <watkins@MORNING To: aix-l@Princeton.EDU
                          SIDE.EDU> cc: (bcc: Chris Baker/NA/GDYR)
                          Sent by: IBM AIX Subject: "sort" problem
                          Discussion List
                          <aix-l@Princeton
                          .EDU>

                          02/26/2004 01:50
                          PM
                          Please respond
                          to IBM AIX
                          Discussion List

    AIXers,

    Given a file "XX" whose contents are the following:
    219.144.82.44
    219.133.253.24
    219.133.146.220
    219.133.136.94
    219.133.65.24
    219.133.11.177

    I'm trying to sort "XX" so the results are as follows:
    219.133.11.177
    219.133.65.24
    219.133.136.94
    219.133.146.220
    219.133.253.24
    219.144.82.44

    I've tried the following sort :
    sort -u -d -t. +0 -n +1 -n +2 -n +3 -n XX

    But the results are as follows: (The 3rd column is out of order)
    219.133.11.177
    219.133.136.94
    219.133.146.220
    219.133.253.24
    219.133.65.24
    219.144.82.44

    When I do sort -u -d -t. +2 -n +3 -n XX (The 3rd & 4th columns are in
    order)
    I get the following:
    219.133.11.177
    219.133.65.24
    219.144.82.44
    219.133.136.94
    219.133.146.220
    219.133.253.24

    I've also tried the following which work OK on the column specified:
     sort -u -d -t. +3 -n XX
     sort -u -d -t. +2 -n XX
     sort -u -d -t. +1 -n XX

    What am I missing in the sort:
    sort -u -d -t. +0 -n +1 -n +2 -n +3 -n XX

    ?

    Thanks,
    Denny Watkins
    Director Computer Services
    Morningside College
    1501 Morningside Ave
    Sioux City, Ia 51106-1717
    Phone: 1-712-274-5250


  • Next message: Edson Noboru Yamada: "HACMP question about clsmuxpd and snmp"

    Relevant Pages

    • Re: sort
      ... Use sort -k1.5n ... Goodyear Tire and Rubber Company ... written consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: syslog and tuning
      ... written consent of The Goodyear Tire & Rubber Company. ... filesystems that reside on fibre attached EMC SAN and a FAStT500. ...
      (AIX-L)
    • Re: Simple samba question
      ... May Contain Confidential and/or Proprietary Information. ... written consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: /var/adm/wtmp
      ... Senior Technical Support Analyst ... Goodyear Tire and Rubber Company ... written consent of The Goodyear Tire & Rubber Company. ... deamon logger of some sort. ...
      (AIX-L)
    • Re: IntelliStation Power 275
      ... Goodyear Tire and Rubber Company ... written consent of The Goodyear Tire & Rubber Company. ... workstations will not beep? ... We have a few users who claim that they need the DVD drives on these ...
      (AIX-L)