<?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: Command opposite to diff in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176723#M793916</link>
    <description>but the nag is that the columns do NOT evenly distribute. Your awk solution is very void:&lt;BR /&gt;&lt;BR /&gt;Try below yourself, because the forum strips whitespace!&lt;BR /&gt;&lt;BR /&gt;lt09:/home/merijn 101 &amp;gt; cat &amp;gt;x0&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;dd&lt;BR /&gt;ff&lt;BR /&gt;gg&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 102 &amp;gt; cat &amp;gt;x1&lt;BR /&gt;aa&lt;BR /&gt;cc&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 103 &amp;gt; comm x0 x1&lt;BR /&gt;                aa&lt;BR /&gt;bb&lt;BR /&gt;        cc&lt;BR /&gt;dd&lt;BR /&gt;                ff&lt;BR /&gt;gg&lt;BR /&gt;                hh&lt;BR /&gt;lt09:/home/merijn 104 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And now with duplicate lines (still sorted!)&lt;BR /&gt;&lt;BR /&gt;lt09:/home/merijn 104 &amp;gt; cat &amp;gt; x0&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;dd&lt;BR /&gt;ff&lt;BR /&gt;ff&lt;BR /&gt;gg&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 105 &amp;gt; cat &amp;gt;x1&lt;BR /&gt;aa&lt;BR /&gt;cc&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 106 &amp;gt; comm x0 x1&lt;BR /&gt;                aa&lt;BR /&gt;bb&lt;BR /&gt;        cc&lt;BR /&gt;dd&lt;BR /&gt;                ff&lt;BR /&gt;ff&lt;BR /&gt;gg&lt;BR /&gt;                hh&lt;BR /&gt;        hh&lt;BR /&gt;lt09:/home/merijn 107 &amp;gt; perl -e'$f=pop;%l=map{$_=&amp;gt;1}&amp;lt;&amp;gt;;@ARGV=($f);for(&amp;lt;&amp;gt;){exists$l{$_}and print}' x0 x1&lt;BR /&gt;aa&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 108 &amp;gt; lt09:/home/merijn 108 &amp;gt; perl -e'$f=pop;%l=map{$_=&amp;gt;1}&amp;lt;&amp;gt;;@ARGV=($f);for(&amp;lt;&amp;gt;){exists$l{$_}and print}' x1 x0&lt;BR /&gt;aa&lt;BR /&gt;ff&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 109 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Hope this sheds some light&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn&lt;BR /&gt;</description>
    <pubDate>Wed, 28 Jan 2004 14:38:46 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2004-01-28T14:38:46Z</dc:date>
    <item>
      <title>Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176712#M793905</link>
      <description>Hey folks,&lt;BR /&gt;&lt;BR /&gt;I'm looking for a unix (hpux 11.00) command that does just reverse of diff command. instead of showing lines that are different, I want it to show lines that are the same.&lt;BR /&gt;&lt;BR /&gt;can someone tell me please!!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sailesh</description>
      <pubDate>Wed, 28 Jan 2004 13:37:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176712#M793905</guid>
      <dc:creator>Sailesh_1</dc:creator>
      <dc:date>2004-01-28T13:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176713#M793906</link>
      <description>Yes - cmp&lt;BR /&gt;&lt;BR /&gt;man cmp&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 28 Jan 2004 13:44:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176713#M793906</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-01-28T13:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176714#M793907</link>
      <description>Depending on your specific task... try the manpage on cmp and comm?</description>
      <pubDate>Wed, 28 Jan 2004 13:46:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176714#M793907</guid>
      <dc:creator>Robert Kerr</dc:creator>
      <dc:date>2004-01-28T13:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176715#M793908</link>
      <description>Hi Sailesh,&lt;BR /&gt;&lt;BR /&gt;'comm' is the one you are looking for. Look at the man page of comm. You are interested in -3 option which is "Lines that appear in both files".&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 28 Jan 2004 13:46:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176715#M793908</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-28T13:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176716#M793909</link>
      <description>Hi,&lt;BR /&gt;perhaps the comm command could be useful...&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Wed, 28 Jan 2004 13:50:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176716#M793909</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-01-28T13:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176717#M793910</link>
      <description>Thanks to you all who responded..That's what I'm looking for.&lt;BR /&gt;&lt;BR /&gt;Sailesh</description>
      <pubDate>Wed, 28 Jan 2004 13:56:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176717#M793910</guid>
      <dc:creator>Sailesh_1</dc:creator>
      <dc:date>2004-01-28T13:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176718#M793911</link>
      <description>Hi Sailesh,&lt;BR /&gt;&lt;BR /&gt;Although I always use comm, it should be noted that &lt;BR /&gt;sdiff -l file1 file2&lt;BR /&gt;will show only identical lines on the left side of output.&lt;BR /&gt;and &lt;BR /&gt;sdiff file1 file2 &lt;BR /&gt;will outpout lines w/o a "|", "&amp;lt;" or "&amp;gt;" that are identical.&lt;BR /&gt;and finally &lt;BR /&gt;sdiff -o file.out file1 file2 &lt;BR /&gt;will print identical lines unaltered but will prompt for action on diffs.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Wed, 28 Jan 2004 14:01:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176718#M793911</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-01-28T14:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176719#M793912</link>
      <description>I always though it should be "comm -3" but I learned otherwise in a thread last week:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=388167" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=388167&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It's actually "comm -12" - try it!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 28 Jan 2004 14:02:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176719#M793912</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-01-28T14:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176720#M793913</link>
      <description>Shridar, it's reverse&lt;BR /&gt;&lt;BR /&gt;-1 don't show lines only in file 1&lt;BR /&gt;-2 don't show lines only in file 2&lt;BR /&gt;-3 don't show lines in both files&lt;BR /&gt;&lt;BR /&gt;comm is the command, but the option is not -3, but -12&lt;BR /&gt;&lt;BR /&gt;And please also read thread &lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=388167" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=388167&lt;/A&gt; where the same question is answwred in more depth, and I also post what differs between comm, and the perl and sed solution that also work on unsorted files:&lt;BR /&gt;&lt;BR /&gt;perl -e'$f=pop;%l=map{$_=&amp;gt;1}&amp;lt;&amp;gt;;@ARGV=($f);for(&amp;lt;&amp;gt;){exists$l{$_}and print}' fileA fileB&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 28 Jan 2004 14:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176720#M793913</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-01-28T14:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176721#M793914</link>
      <description>Hi Sailesh,&lt;BR /&gt;&lt;BR /&gt;Pete is correct. comm -12 will display the common lines provided the files are sorted. So, you will need to create two temporary files and then use comm against them.&lt;BR /&gt;&lt;BR /&gt;Comm with -3 suppresses column 3. So, you would use&lt;BR /&gt;&lt;BR /&gt;comm file1 file2 |awk '{print $3}'&lt;BR /&gt;&lt;BR /&gt;to get the result which is as same as comm -12&lt;BR /&gt;&lt;BR /&gt;Key is that the files are to be sorted.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 28 Jan 2004 14:13:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176721#M793914</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-28T14:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176722#M793915</link>
      <description>Gotcha Merijn - How deceiving a man page can be?&lt;BR /&gt;&lt;BR /&gt;In fact it is a mere context miss &lt;BR /&gt;&lt;BR /&gt;Column 1:   Lines that appear only in file1,&lt;BR /&gt;Column 2:   Lines that appear only in file2,&lt;BR /&gt;Column 3:   Lines that appear in both files.&lt;BR /&gt;&lt;BR /&gt;Where the context is "comm produces a three column output".&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 28 Jan 2004 14:19:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176722#M793915</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-28T14:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176723#M793916</link>
      <description>but the nag is that the columns do NOT evenly distribute. Your awk solution is very void:&lt;BR /&gt;&lt;BR /&gt;Try below yourself, because the forum strips whitespace!&lt;BR /&gt;&lt;BR /&gt;lt09:/home/merijn 101 &amp;gt; cat &amp;gt;x0&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;dd&lt;BR /&gt;ff&lt;BR /&gt;gg&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 102 &amp;gt; cat &amp;gt;x1&lt;BR /&gt;aa&lt;BR /&gt;cc&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 103 &amp;gt; comm x0 x1&lt;BR /&gt;                aa&lt;BR /&gt;bb&lt;BR /&gt;        cc&lt;BR /&gt;dd&lt;BR /&gt;                ff&lt;BR /&gt;gg&lt;BR /&gt;                hh&lt;BR /&gt;lt09:/home/merijn 104 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And now with duplicate lines (still sorted!)&lt;BR /&gt;&lt;BR /&gt;lt09:/home/merijn 104 &amp;gt; cat &amp;gt; x0&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;dd&lt;BR /&gt;ff&lt;BR /&gt;ff&lt;BR /&gt;gg&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 105 &amp;gt; cat &amp;gt;x1&lt;BR /&gt;aa&lt;BR /&gt;cc&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 106 &amp;gt; comm x0 x1&lt;BR /&gt;                aa&lt;BR /&gt;bb&lt;BR /&gt;        cc&lt;BR /&gt;dd&lt;BR /&gt;                ff&lt;BR /&gt;ff&lt;BR /&gt;gg&lt;BR /&gt;                hh&lt;BR /&gt;        hh&lt;BR /&gt;lt09:/home/merijn 107 &amp;gt; perl -e'$f=pop;%l=map{$_=&amp;gt;1}&amp;lt;&amp;gt;;@ARGV=($f);for(&amp;lt;&amp;gt;){exists$l{$_}and print}' x0 x1&lt;BR /&gt;aa&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 108 &amp;gt; lt09:/home/merijn 108 &amp;gt; perl -e'$f=pop;%l=map{$_=&amp;gt;1}&amp;lt;&amp;gt;;@ARGV=($f);for(&amp;lt;&amp;gt;){exists$l{$_}and print}' x1 x0&lt;BR /&gt;aa&lt;BR /&gt;ff&lt;BR /&gt;ff&lt;BR /&gt;hh&lt;BR /&gt;lt09:/home/merijn 109 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Hope this sheds some light&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2004 14:38:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176723#M793916</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-01-28T14:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176724#M793917</link>
      <description>Well - I wish HP could replace it's comm command with your perl script :-)&lt;BR /&gt;&lt;BR /&gt;grep -f file1 file2&lt;BR /&gt;&lt;BR /&gt;If we want a simple solution. No sorting is needed.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 28 Jan 2004 14:46:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176724#M793917</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-28T14:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176725#M793918</link>
      <description>No won't work. See other thread&lt;BR /&gt;&lt;BR /&gt;what if file1 has wildcards?&lt;BR /&gt;&lt;BR /&gt;# cat &amp;gt;file1&lt;BR /&gt;.*&lt;BR /&gt;# cat &amp;gt;file2&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;# grep -f file1 file2&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;# grep -f file2 file1&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;as also from the other thread one uses GNU grep, it might work:&lt;BR /&gt;&lt;BR /&gt;# grep -xFf file1 file2&lt;BR /&gt;&lt;BR /&gt;but not all of us are so lucky to have taken the time to have HP's grep replaced with GNU grep&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 28 Jan 2004 14:57:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176725#M793918</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-01-28T14:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Command opposite to diff</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176726#M793919</link>
      <description>That's a great show Merijn. Thanks. Ofcourse Enjoyed and had fun. &lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 28 Jan 2004 15:37:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-opposite-to-diff/m-p/3176726#M793919</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-28T15:37:47Z</dc:date>
    </item>
  </channel>
</rss>

