incorrect sort if using multiple keys with mixed order

From: Frederick Leung (fleun_at_doh.health.nsw.gov.au)
Date: 06/16/05

  • Next message: Dr. Martin Körfer: "change of cluster-alias"
    Date: Thu, 16 Jun 2005 17:20:10 +1000
    To: tru64-unix-managers@ornl.gov
    
    

    hello t64-managers,

    anyone knows if there is a bug on the sort command ?

    DU 5.1A -

    for eg.
    I want to sort data first by field 1 in ascending and then
    by field 4 in numerically descending order.

    but the command "sort -t'^' -k1 -k4nr <file>" only gives
     the following output which is the same result as given
     by sort -k1 -k4n:-

    q^d^D^20050623
    q^e^D^20050626
    q^f^D^20050628
    x^c^D^20050609
    x^e^D^20050611
    x^h^D^20050616
    x^k^D^20050621
    y^a^D^20050619
    y^b^D^20050621
    y^c^D^20050622

    Thanks for any response to my problem.

    Frederick.
    fleun@doh.health.nsw.gov.au


  • Next message: Dr. Martin Körfer: "change of cluster-alias"

    Relevant Pages

    • Re: VIM: How to execute command on visual block?
      ... The Sort command requires selecting ... After I source the sort functions involved, I can then highlight a block of text in a file, and then do ... Sapere, saper fare, fare, far sapere http://gmax.oltrelinux.com. ...
      (comp.editors)
    • Re: Ordering large files (in perl?)
      ... This is just using Perl to invoke the system sort utility. ... Most unix-like systems' sort command will do this automatically if they ... I wish there were a way to tell it to gzip those temp files, ...
      (comp.lang.perl.misc)
    • Re: Efficient Text File Copy
      ... it is even better to end the sort command ... output file) using regular I/O redirection. ... I'd think any reasonable STL-based solution (such as using ...
      (comp.lang.c)
    • Re: Sort command with very large files
      ... I am extracting records from many tables of a database into flat files, ... and then running a sort command on all the extracted files. ...
      (comp.unix.shell)
    • Re: Using Shell sort, returning unpredictable results (well almost)
      ... I'm trying to sort a file with dates but the outcome is not quite doing ... order according to the dates so I use the following sort command. ... This almost works except the days are descending rather than ascending ... If it's Perl you want: ...
      (comp.unix.shell)