<?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: How to print duplicate lines alone in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932247#M818552</link>
    <description>I'd just write a small script fragment to process the output from your uniq -c example...&lt;BR /&gt;&lt;BR /&gt;integer N&lt;BR /&gt;uniq -c serrlog | {&lt;BR /&gt;while read N LINE&lt;BR /&gt;do&lt;BR /&gt; while (( N &amp;gt; 0 ));&lt;BR /&gt; do&lt;BR /&gt;  print -- "${LINE}"&lt;BR /&gt;  let N=N-1&lt;BR /&gt; done&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
    <pubDate>Thu, 20 Mar 2003 18:31:37 GMT</pubDate>
    <dc:creator>John Palmer</dc:creator>
    <dc:date>2003-03-20T18:31:37Z</dc:date>
    <item>
      <title>How to print duplicate lines alone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932243#M818548</link>
      <description>I want to know how to print duplicate lines alone from a file. &lt;BR /&gt;When I tried 'uniq -c', tt prints number of times and line. For eg.&lt;BR /&gt;&lt;BR /&gt;$ uniq -c serrlog&lt;BR /&gt; 1 error 04: connection failure&lt;BR /&gt; 4 error 11: /tmp directory not found&lt;BR /&gt; 1 error 17: low disk space&lt;BR /&gt; 2 error 22: out of memory&lt;BR /&gt;&lt;BR /&gt;Instead of printing just number of times, I need to have print &lt;BR /&gt;&lt;BR /&gt;I am not sure this option is available on any command on the unix. &lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;Regards&lt;BR /&gt;Nesan</description>
      <pubDate>Thu, 20 Mar 2003 17:18:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932243#M818548</guid>
      <dc:creator>Nesan</dc:creator>
      <dc:date>2003-03-20T17:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to print duplicate lines alone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932244#M818549</link>
      <description>Hi Nesan:&lt;BR /&gt;&lt;BR /&gt;Here's a quick, crude way to do this:&lt;BR /&gt;&lt;BR /&gt;Given your file (sorted, of course):&lt;BR /&gt;&lt;BR /&gt;# uniq -u myfile &amp;gt; myfile.tmp&lt;BR /&gt;# diff myfile.tmp myfile|sed -n '/&amp;gt;/p'|sed -e 's/&amp;gt; //g'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 20 Mar 2003 17:40:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932244#M818549</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-20T17:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to print duplicate lines alone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932245#M818550</link>
      <description>Hi Nesan&lt;BR /&gt;&lt;BR /&gt;Did you try 'uniq -d' ?&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 20 Mar 2003 17:46:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932245#M818550</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-03-20T17:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to print duplicate lines alone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932246#M818551</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm not quite sure what you're after as it looks like you chopped off part of your question ;)&lt;BR /&gt;&lt;BR /&gt;If you want to see all unique lines plus one copy of the duplicates, without the number of duplicates at the front then you should use:&lt;BR /&gt;uniq serrlog&lt;BR /&gt;&lt;BR /&gt;This is equivalent to uniq -ud serrlog.  The -c option is adding the numbers.&lt;BR /&gt;&lt;BR /&gt;uniq -d serlog will give you one line for each duplicate - without numbers.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Darren.</description>
      <pubDate>Thu, 20 Mar 2003 17:51:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932246#M818551</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2003-03-20T17:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to print duplicate lines alone</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932247#M818552</link>
      <description>I'd just write a small script fragment to process the output from your uniq -c example...&lt;BR /&gt;&lt;BR /&gt;integer N&lt;BR /&gt;uniq -c serrlog | {&lt;BR /&gt;while read N LINE&lt;BR /&gt;do&lt;BR /&gt; while (( N &amp;gt; 0 ));&lt;BR /&gt; do&lt;BR /&gt;  print -- "${LINE}"&lt;BR /&gt;  let N=N-1&lt;BR /&gt; done&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Thu, 20 Mar 2003 18:31:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-print-duplicate-lines-alone/m-p/2932247#M818552</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2003-03-20T18:31:37Z</dc:date>
    </item>
  </channel>
</rss>

