<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sort command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323128#M877720</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;please bear me for more questions:&lt;BR /&gt;&lt;BR /&gt;But what about the fourth field? The second record has less value (1117) than the first record (1118). The fourth field should be considered before the ninth one.&lt;BR /&gt;&lt;BR /&gt;Doesn't "sort -n -t'|' -k 1,5 -k 9 gg" mean that first 5 fields should be considered first and only if they are equal then consider the ninth field?&lt;BR /&gt;&lt;BR /&gt;"sort -n -t'|' -k 1,5 gg | sort -n -t'|' -k 9" is not and shouldn't be as same as "sort -n -t'|' -k 1,5 -k 9 gg"&lt;BR /&gt;&lt;BR /&gt;my intention of "sort -n -t'|' -k 1,5 -k 9 gg" was to sort the file based on the combination of six fields: 1 to 5 and 9.&lt;BR /&gt;&lt;BR /&gt;Please correct me if I'm misunderstanding the man page.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Babak&lt;BR /&gt;</description>
    <pubDate>Tue, 06 Jul 2004 11:51:00 GMT</pubDate>
    <dc:creator>Babak_4</dc:creator>
    <dc:date>2004-07-06T11:51:00Z</dc:date>
    <item>
      <title>sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323121#M877713</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;here is my file's content:&lt;BR /&gt;$ cat gg&lt;BR /&gt;9|4|1|1118|-7.79|607|K7K|6B3|3.309&lt;BR /&gt;9|4|1|1117|7.49|724|N1K|1R7|4.981&lt;BR /&gt;&lt;BR /&gt;and here is my sort:&lt;BR /&gt;$ sort -n -t'|' -k 1,5 -k 9 gg&lt;BR /&gt;9|4|1|1118|-7.79|607|K7K|6B3|3.309&lt;BR /&gt;9|4|1|1117|7.49|724|N1K|1R7|4.981&lt;BR /&gt;&lt;BR /&gt;As you see the second line should come first, since its fourth field is less than the first&lt;BR /&gt;record's.&lt;BR /&gt;&lt;BR /&gt;But when I remove -k 9 it works fine:&lt;BR /&gt;$ sort -n -t'|' -k 1,5  gg&lt;BR /&gt;9|4|1|1117|7.49|724|N1K|1R7|4.981&lt;BR /&gt;9|4|1|1118|-7.79|607|K7K|6B3|3.309&lt;BR /&gt;&lt;BR /&gt;Am I doing a silly mistake here? or ...&lt;BR /&gt;&lt;BR /&gt;I appreciate your help.&lt;BR /&gt;&lt;BR /&gt;Babak&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jul 2004 10:41:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323121#M877713</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-05T10:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323122#M877714</link>
      <description>Babak,&lt;BR /&gt;from man of "sort"&lt;BR /&gt;" When there are multiple sort keys, later keys are compared only after all earlier keys compare equal.  &lt;BR /&gt;Lines that otherwise compare equal are ordered with all bytes significant. &lt;BR /&gt;If all the specified keys compare equal, the entire record is used as the final key. "&lt;BR /&gt;&lt;BR /&gt;Hope that addresses your issue.&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jul 2004 11:11:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323122#M877714</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-07-05T11:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323123#M877715</link>
      <description>Hi Bharat,&lt;BR /&gt;&lt;BR /&gt;thanks for it, but still I'm confeused. the first key -k 1,5 says sort on the first five fields, so the second record should come first,(as it does when -k 9 is removed),   or mein understanding is wrong?&lt;BR /&gt;&lt;BR /&gt;Babak</description>
      <pubDate>Mon, 05 Jul 2004 12:12:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323123#M877715</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-05T12:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323124#M877716</link>
      <description>Hi Babak,&lt;BR /&gt;Compare following two Outputs:&lt;BR /&gt;&lt;BR /&gt;1. $ sort -n -t'|' -k 1,9 -k 9 gg&lt;BR /&gt;2. $ sort -n -t'|' -k 1,9 gg&lt;BR /&gt;&lt;BR /&gt;I hope both should be same.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;p.s. I have counted the PIPE also.</description>
      <pubDate>Mon, 05 Jul 2004 14:38:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323124#M877716</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-07-05T14:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323125#M877717</link>
      <description>Sorry, I can't get your point. Anyway I tried yours, and they are not same!&lt;BR /&gt;Something that I found is if I remove -n from "sort -n -t'|' -k 1,5 -k 9 gg" it works!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Babak&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jul 2004 15:04:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323125#M877717</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-05T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323126#M877718</link>
      <description>I guess sort has a problem with multiple -k. Is it a known issue and is there any patch for it? &lt;BR /&gt;&lt;BR /&gt;Babak</description>
      <pubDate>Tue, 06 Jul 2004 08:53:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323126#M877718</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-06T08:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323127#M877719</link>
      <description>Hai,&lt;BR /&gt;&lt;BR /&gt; Bharath gave the key point from sort man page. If we are using multiple key value on the sort command, it will process key 1 and to key n.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;When there are&lt;BR /&gt;                       multiple sort keys, later keys are compared only&lt;BR /&gt;                       after all earlier keys compare equal.  Lines that&lt;BR /&gt;                       otherwise compare equal are ordered with all bytes&lt;BR /&gt;                       significant&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt; From your example,&lt;BR /&gt;  sort -n -t'|' -k 1,5 -k 9 gg&lt;BR /&gt;&lt;BR /&gt; It will be processed as like,&lt;BR /&gt;&lt;BR /&gt; sort -n -t'|' -k 1,5 gg | sort -n -t'|' -k 9&lt;BR /&gt;&lt;BR /&gt; The output is also descibing that,&lt;BR /&gt; 9|4|1|1118|-7.79|607|K7K|6B3|3.309&lt;BR /&gt; 9|4|1|1117|7.49|724|N1K|1R7|4.981&lt;BR /&gt;&lt;BR /&gt; Look at the ninth field, of 3.309 and 4.981 they are sorted as your requirement.&lt;BR /&gt;&lt;BR /&gt; The contents of your example strings are sorted with key 1,5 fields in the begin and with key 9 in the end.&lt;BR /&gt;&lt;BR /&gt; The key's we are using to sort must be significant.&lt;BR /&gt;&lt;BR /&gt; If you test the example as like,&lt;BR /&gt;&lt;BR /&gt; sort -n -t'|' -k 9 -k 1,5 gg&lt;BR /&gt; &lt;BR /&gt; The above details will be changed,&lt;BR /&gt; It must be &lt;BR /&gt; 9|4|1|1117|7.49|724|N1K|1R7|4.981&lt;BR /&gt; 9|4|1|1118|-7.79|607|K7K|6B3|3.309&lt;BR /&gt;&lt;BR /&gt; It will not come. sort  call is working as stated in the man page. &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Muthukumar.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jul 2004 10:38:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323127#M877719</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-07-06T10:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323128#M877720</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;please bear me for more questions:&lt;BR /&gt;&lt;BR /&gt;But what about the fourth field? The second record has less value (1117) than the first record (1118). The fourth field should be considered before the ninth one.&lt;BR /&gt;&lt;BR /&gt;Doesn't "sort -n -t'|' -k 1,5 -k 9 gg" mean that first 5 fields should be considered first and only if they are equal then consider the ninth field?&lt;BR /&gt;&lt;BR /&gt;"sort -n -t'|' -k 1,5 gg | sort -n -t'|' -k 9" is not and shouldn't be as same as "sort -n -t'|' -k 1,5 -k 9 gg"&lt;BR /&gt;&lt;BR /&gt;my intention of "sort -n -t'|' -k 1,5 -k 9 gg" was to sort the file based on the combination of six fields: 1 to 5 and 9.&lt;BR /&gt;&lt;BR /&gt;Please correct me if I'm misunderstanding the man page.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Babak&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jul 2004 11:51:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323128#M877720</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-06T11:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323129#M877721</link>
      <description>If you sort on -k 4,5 -k 9 then it works.&lt;BR /&gt; &lt;BR /&gt;If you change your data line #2 position 1 to an "8", then the sort works.&lt;BR /&gt; &lt;BR /&gt;If you seperate the keys out to -k 1,1 -k 2,2 -k 3,3 -k 4,4 -k 5,5 -k 9,9, then it works.&lt;BR /&gt; &lt;BR /&gt;It is acting like the key "range" -k 1,5 is thinks it is a duplicate key field when only the first field position is duplicated.&lt;BR /&gt; &lt;BR /&gt;It looks like a bug to me...&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 06 Jul 2004 11:51:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323129#M877721</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-07-06T11:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323130#M877722</link>
      <description>It would be very helpful is someone from HP confirm this.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Babak</description>
      <pubDate>Wed, 07 Jul 2004 12:45:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323130#M877722</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-07T12:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323131#M877723</link>
      <description>I have here syncsort as a replacement for sort on HP server (faster, better, more expensive :).&lt;BR /&gt;&lt;BR /&gt;I have exactly the same sort with this second program. I can't imagine the similar bug on two so used programs.&lt;BR /&gt;&lt;BR /&gt;What I understand in man is that specifying multiple keys of multiple fields will compare second fields of each keys only if first fileds of each keys are equal. And so on for second fields, third...&lt;BR /&gt;&lt;BR /&gt;An exapmle for I say with your example :&lt;BR /&gt;add a -k 4 in your sort, and it will do.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 13:09:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323131#M877723</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-07T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323132#M877724</link>
      <description>I also tried it with a linux system and a true-64 system, and it works behaves exactly the same way on them. So maybe it is not a bug. I too am interested in hearing from some authoritative source if it IS a bug or not.</description>
      <pubDate>Wed, 07 Jul 2004 13:16:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323132#M877724</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2004-07-07T13:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323133#M877725</link>
      <description>On a Sun OS 5.6,&lt;BR /&gt;&lt;BR /&gt;with sort :&lt;BR /&gt;$/usr/bin/sort -n -t'|' -k 1,5 -k 9 sort_file&lt;BR /&gt;9|4|1|1118|-7.79|607|K7K|6B3|3.309&lt;BR /&gt;9|4|1|1117|7.49|724|N1K|1R7|4.981&lt;BR /&gt;&lt;BR /&gt;with syncsort :&lt;BR /&gt;$sort -n -t'|' -k 1,5 -k 9 sort_file 9|4|1|1118|-7.79|607|K7K|6B3|3.309&lt;BR /&gt;9|4|1|1117|7.49|724|N1K|1R7|4.981&lt;BR /&gt;&lt;BR /&gt;It acts the same again. Confort me in my opinion : it's not a bug, it's a feature :)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 13:30:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323133#M877725</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-07T13:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323134#M877726</link>
      <description>It look weird, but you will ned to EXPLICITY state the order one by one It look like the implied 1,5 does not wotk!!&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;sort -n -t'|' -k 1,5 -k 9 gg&lt;BR /&gt;is the same as &lt;BR /&gt;sort -n -t'|' -k 9 -k 1,5 gg&lt;BR /&gt;&lt;BR /&gt;what you want is&lt;BR /&gt;sort -n -t'|' -k1 -k2 -k3 -k4 -k5 -k9 gg&lt;BR /&gt;will be different to &lt;BR /&gt;sort -n -t'|' -k9 -k5 -k4 -k3 -k2 -k1 gg&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;Tim&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 13:37:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323134#M877726</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2004-07-07T13:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323135#M877727</link>
      <description>Fred,&lt;BR /&gt;&lt;BR /&gt;thanks for response. But I tried it with syncsort, it works fine. Can you post your syntax? I want to be sure that syncsort does not behave like unix sort. &lt;BR /&gt;&lt;BR /&gt;Regarding adding -k 4, as Rod said it works if you specify each field separately, but it's not the way that man page says:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;Restricted Sort Key&lt;BR /&gt;-k keydef    The keydef argument defines a restricted sort key.The format of this definition is&lt;BR /&gt;field_start[type][,field_end[type]]&lt;BR /&gt;which defines a key field beginning at field_start and ending at field_end.&lt;BR /&gt;...&lt;BR /&gt;Multiple -k options are permitted and are significant in command line order.  A maximum of 9 -k options can be given.&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Besides, we've got restriction on number of -k (max. 9).&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Babak&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 13:42:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323135#M877727</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-07T13:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323136#M877728</link>
      <description>I insist :&lt;BR /&gt;Problem is not that 1,5 is not working. Sort is done on first field of each key (1 and 9) then on second field of each key (only 2 because 2nd key do not have other field) and so on. So the sort you ask is equivalent to&lt;BR /&gt;-k 1 -k 9 -k 2 -k 3 -k 4 -k 5&lt;BR /&gt;whereas what you want is&lt;BR /&gt;-k 1,5 -k 4 -k 9&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 13:46:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323136#M877728</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-07T13:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323137#M877729</link>
      <description>Babak,&lt;BR /&gt;&lt;BR /&gt;Didn't saw your answer before posting...&lt;BR /&gt;OK, but note that, as somebody extract it before from man :&lt;BR /&gt;"When there are multiple sort keys, later keys are compared only after all earlier keys compare equal. Lines that otherwise compare equal are ordered with all bytes significant"&lt;BR /&gt;&lt;BR /&gt;syncsort syntax is in my precedent post, the same as sort. I am using sort shell script in syncsort bin directory, and not directly syncsort program.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 13:51:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323137#M877729</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-07T13:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323138#M877730</link>
      <description>Fred,&lt;BR /&gt;&lt;BR /&gt;let me emphasis that "-k 1,5" means "-k 1 -k 2 -k 3 -4 and -k 5". As I mentioned in my earlier reply if you remove -k 9 from my command it works, meaning the value of the fourth field is considered, whereas with -k 9 it doesn't. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Babak&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 14:03:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323138#M877730</guid>
      <dc:creator>Babak_4</dc:creator>
      <dc:date>2004-07-07T14:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323139#M877731</link>
      <description>Babak,&lt;BR /&gt;&lt;BR /&gt;I read from "man sort" that-&lt;BR /&gt; &lt;BR /&gt;sort -k 1,5&lt;BR /&gt;and&lt;BR /&gt;sort -k 1,1 -k 2,2 -k 3,3 -k 4,4 -k 5,5&lt;BR /&gt; &lt;BR /&gt;should be equivalent, but in my previous tests it was not...&lt;BR /&gt; &lt;BR /&gt;Even though it is behaving the same on a Linux system, I would say that HPUX and Linux might share the same source code for a number of utilities, and thus share some of the same bugs.&lt;BR /&gt; &lt;BR /&gt;Whether you call this a bug or an undocumented feature, it still is frustrating when a command doesn't do what you expect it to do.&lt;BR /&gt; &lt;BR /&gt;my 2 cents.&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 15:15:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323139#M877731</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-07-07T15:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: sort command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323140#M877732</link>
      <description>IMHO "-k 1,5" is not equivalent to "-k 1 -k 2 -k 3 -k 4 -k 5".&lt;BR /&gt;&lt;BR /&gt;The first one sorts on a key wich is a concatenation of the first 5 fields. For the second, the 5 first fields have the same importance.&lt;BR /&gt;&lt;BR /&gt;That's why I say that in your original sort, 1 and 9 are sorted first, then 2, then 3... &lt;BR /&gt;&lt;BR /&gt;...and that's why removing 9 works the way you think it (1 2 3 4 and 5 are already distincts).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jul 2004 07:05:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort-command/m-p/3323140#M877732</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-08T07:05:20Z</dc:date>
    </item>
  </channel>
</rss>

