<?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: sorting stuff in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718064#M721664</link>
    <description>&lt;BR /&gt;&lt;BR /&gt;If we use 'd' as the field separator, then we need sort by the second field - correct?&lt;BR /&gt;If so, then try using -k2 instead of -k1,6</description>
    <pubDate>Mon, 06 May 2002 20:18:41 GMT</pubDate>
    <dc:creator>Mladen Despic</dc:creator>
    <dc:date>2002-05-06T20:18:41Z</dc:date>
    <item>
      <title>sorting stuff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718061#M721661</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have an arbitrary input in the following form:&lt;BR /&gt;c0t11d2 NONE 4095   JBOD/Other  SEAGATE&lt;BR /&gt;c0t8d1  NONE 4095   JBOD/Other  SEAGATE &lt;BR /&gt;c0t9d0  NONE 4095   JBOD/Other  SEAGATE&lt;BR /&gt;&lt;BR /&gt;I need to perform sort on device field (dX). &lt;BR /&gt;I am thinking of using &lt;BR /&gt;&lt;BR /&gt;sort -k 1.LengthOfTheDevice  (e.g. sort -k 1.6) filename&lt;BR /&gt;&lt;BR /&gt;Since, the disk name is of variable length, how can I ensure that I always search based on D value?&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Mon, 06 May 2002 19:45:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718061#M721661</guid>
      <dc:creator>andi_1</dc:creator>
      <dc:date>2002-05-06T19:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: sorting stuff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718062#M721662</link>
      <description>sort -t 'd' -n -k2,2</description>
      <pubDate>Mon, 06 May 2002 19:59:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718062#M721662</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2002-05-06T19:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: sorting stuff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718063#M721663</link>
      <description>Sorry, I might have been not clear enough. I have another requirement:&lt;BR /&gt;Suppose, the following info I have:&lt;BR /&gt;c0t0d0  NONE 4095 JBOD/Other SEAGATE &lt;BR /&gt;c0t0d1  NONE 4095 JBOD/Other SEAGATE &lt;BR /&gt;c1t0d0  NONE 4095 JBOD/Other SEAGATE &lt;BR /&gt;c1t1d1  NONE 4095 JBOD/Other SEAGATE &lt;BR /&gt;&lt;BR /&gt;When I sort by d, I also need to make sure that the following output displayed:&lt;BR /&gt;&lt;BR /&gt;c0t0d0  &lt;BR /&gt;c1t0d0  &lt;BR /&gt;c0t0d1  &lt;BR /&gt;c1t1d1  &lt;BR /&gt;&lt;BR /&gt;If I were to use the sort like this:&lt;BR /&gt;sort -t 'd' -n -k1,6 diskDBt&lt;BR /&gt;&lt;BR /&gt;I'd get the following output:&lt;BR /&gt;c0t0d0&lt;BR /&gt;c0d0t1&lt;BR /&gt;c1t0d0&lt;BR /&gt;c1t1d1&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 May 2002 20:09:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718063#M721663</guid>
      <dc:creator>andi_1</dc:creator>
      <dc:date>2002-05-06T20:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: sorting stuff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718064#M721664</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;If we use 'd' as the field separator, then we need sort by the second field - correct?&lt;BR /&gt;If so, then try using -k2 instead of -k1,6</description>
      <pubDate>Mon, 06 May 2002 20:18:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718064#M721664</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2002-05-06T20:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: sorting stuff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718065#M721665</link>
      <description>The suggested solution is very close. If you want to sort by the 'd' portion as the most significant and then then stuff that precedes it using 'd' as a field separator this should work:&lt;BR /&gt;&lt;BR /&gt;sort -t 'd' -k 2,2n -k1,1b infile&lt;BR /&gt;</description>
      <pubDate>Mon, 06 May 2002 20:28:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-stuff/m-p/2718065#M721665</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-05-06T20:28:41Z</dc:date>
    </item>
  </channel>
</rss>

