<?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: Compare two files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500882#M680841</link>
    <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I should explain my situation better.&lt;BR /&gt;&lt;BR /&gt;And I believe I answered what you asked.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank"&gt;http://www.catb.org/~esr/faqs/smart-questions.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Mon, 21 Sep 2009 15:16:43 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-09-21T15:16:43Z</dc:date>
    <item>
      <title>Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500877#M680836</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have List A and List B.  List A contains a list of excludes.  How do I extract from ListB all that is not in List A?</description>
      <pubDate>Mon, 21 Sep 2009 13:48:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500877#M680836</guid>
      <dc:creator>dev44</dc:creator>
      <dc:date>2009-09-21T13:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500878#M680837</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;use 'comm' [see the manpages for details].&lt;BR /&gt;&lt;BR /&gt;# comm -23 fileb filea&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:00:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500878#M680837</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-09-21T14:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500879#M680838</link>
      <description>I don't think that will work.  I should explain my situation better.  File A will contain the following:&lt;BR /&gt;&lt;BR /&gt;/var&lt;BR /&gt;/stand&lt;BR /&gt;/tmp&lt;BR /&gt;&lt;BR /&gt;Then List B will have something that looks like this:&lt;BR /&gt;&lt;BR /&gt;/abc/def/ghi/jkl/file.ksh&lt;BR /&gt;/var/adm/syslog/syslog.log&lt;BR /&gt;/tmp/file.txt&lt;BR /&gt;/anotherdir/path/file&lt;BR /&gt;&lt;BR /&gt;So I want to output all in FileB except anything with the string in it from FileA.  So anything that starts with /var; /stand; or /tmp.  &lt;BR /&gt;&lt;BR /&gt;I am trying to find all files of a certain type from all directories BUT the ones in  ListA.  I have a find that will print out all the files found.  Then I was thinking I could somehow grep out all files starting with anything in List A.</description>
      <pubDate>Mon, 21 Sep 2009 14:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500879#M680838</guid>
      <dc:creator>dev44</dc:creator>
      <dc:date>2009-09-21T14:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500880#M680839</link>
      <description>How about &lt;BR /&gt;grep -i -f listA listB&lt;BR /&gt;&lt;BR /&gt;To avoid substring matching probably need to "-w" as well&lt;BR /&gt;grep -i -w -f listA listB&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:22:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500880#M680839</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-09-21T14:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500881#M680840</link>
      <description>I used the wrong option. It should be -v instaead of -i. But it will still miss the substrings.&lt;BR /&gt;grep -v -w -f listA listB&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Sep 2009 14:27:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500881#M680840</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-09-21T14:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500882#M680841</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I should explain my situation better.&lt;BR /&gt;&lt;BR /&gt;And I believe I answered what you asked.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank"&gt;http://www.catb.org/~esr/faqs/smart-questions.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 21 Sep 2009 15:16:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500882#M680841</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-09-21T15:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500883#M680842</link>
      <description>The important prerequisite for the "comm" command is that the two files MUST be sorted. Another fact is that the comparison is done on a whole line basis. That is if "/var" is in ListA, then "/var" would be excluded from ListB but "/var/opt" would NOT be excluded from listB. &lt;BR /&gt;Apparently in this case that is the behavior you want. In some cases it would not be and the grep command would fail in that case. &lt;BR /&gt;Also the grep command would fail in your case as well, if you have "/var" in listA and /usr/opt/common/var/keep" in ListB.</description>
      <pubDate>Mon, 21 Sep 2009 16:43:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500883#M680842</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-09-21T16:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500884#M680843</link>
      <description>&amp;gt;So I want to output all in FileB except anything with the string in it from FileA. So anything that starts with /var; /stand; or /tmp.&lt;BR /&gt;&lt;BR /&gt;You will need to change FileA so that you anchor the RE:&lt;BR /&gt;^/var&lt;BR /&gt;^/tmp&lt;BR /&gt;^/stand&lt;BR /&gt;&lt;BR /&gt;Then you can use:&lt;BR /&gt;grep -v -f FileA FileB</description>
      <pubDate>Tue, 22 Sep 2009 07:37:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-files/m-p/4500884#M680843</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-09-22T07:37:16Z</dc:date>
    </item>
  </channel>
</rss>

