<?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: PATHETICALLY simple diff script question. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858518#M713340</link>
    <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;The simplest case would be something like:&lt;BR /&gt;&lt;BR /&gt;diff file1 file2 &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;        echo "the files are the same"&lt;BR /&gt;else&lt;BR /&gt;        echo "the files are different"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of course, you'd probably want to first make sure "file1" and "file2" exist, and you'd also want the ksh program to take the file names as arguments.  You could also call cksum against the two files and compare the output, but the above syntax should work for using diff against two files.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave</description>
    <pubDate>Fri, 27 Aug 2004 08:55:58 GMT</pubDate>
    <dc:creator>Dave Olker</dc:creator>
    <dc:date>2004-08-27T08:55:58Z</dc:date>
    <item>
      <title>PATHETICALLY simple diff script question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858514#M713336</link>
      <description>I haven't had my coffee yet.  I am ashamed to ask.  But.....&lt;BR /&gt;&lt;BR /&gt;I have two files:  A and B. &lt;BR /&gt;&lt;BR /&gt;I would like a snippet of shell code. &lt;BR /&gt;&lt;BR /&gt;if [  ??????? ] ; then &lt;BR /&gt;    echo " the files are the same"&lt;BR /&gt;else&lt;BR /&gt;    echo " the files are different"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;I don't need to know the exact differences, just that they ARE different.  &lt;BR /&gt;&lt;BR /&gt;steve&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2004 08:40:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858514#M713336</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2004-08-27T08:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: PATHETICALLY simple diff script question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858515#M713337</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;install md5sum package and check&lt;BR /&gt;&lt;BR /&gt;if [ "`md5sum A | awk '{print $1}'`" = "`md5sum B | awk '{print $1}'`" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "the files are the same"&lt;BR /&gt;else&lt;BR /&gt;  echo " the files are different"&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2004 08:49:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858515#M713337</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2004-08-27T08:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: PATHETICALLY simple diff script question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858516#M713338</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;or using diff&lt;BR /&gt;&lt;BR /&gt;A=file1&lt;BR /&gt;B=file2&lt;BR /&gt;&lt;BR /&gt;if [ "`diff $A $B`" = "" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "the files are the same"&lt;BR /&gt;else&lt;BR /&gt;  echo " the files are different"&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2004 08:53:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858516#M713338</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2004-08-27T08:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: PATHETICALLY simple diff script question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858517#M713339</link>
      <description>Thanks.  I see I gave you 20 points.  But they are two distinct answers. &lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 27 Aug 2004 08:55:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858517#M713339</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2004-08-27T08:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: PATHETICALLY simple diff script question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858518#M713340</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;The simplest case would be something like:&lt;BR /&gt;&lt;BR /&gt;diff file1 file2 &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;        echo "the files are the same"&lt;BR /&gt;else&lt;BR /&gt;        echo "the files are different"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of course, you'd probably want to first make sure "file1" and "file2" exist, and you'd also want the ksh program to take the file names as arguments.  You could also call cksum against the two files and compare the output, but the above syntax should work for using diff against two files.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave</description>
      <pubDate>Fri, 27 Aug 2004 08:55:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858518#M713340</guid>
      <dc:creator>Dave Olker</dc:creator>
      <dc:date>2004-08-27T08:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: PATHETICALLY simple diff script question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858519#M713341</link>
      <description>diff returns 0 if no differences, 1 if differences or &amp;gt;1 if error.  So: -&lt;BR /&gt;&lt;BR /&gt;diff file1 file2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;  echo "The files are the same"&lt;BR /&gt;elif [ $? -eq 1 ]; then&lt;BR /&gt;  echo "The files are different"&lt;BR /&gt;else&lt;BR /&gt;  echo "There was an error"&lt;BR /&gt;fi</description>
      <pubDate>Fri, 27 Aug 2004 08:57:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858519#M713341</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2004-08-27T08:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: PATHETICALLY simple diff script question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858520#M713342</link>
      <description>ok.  closing thread now.  &lt;BR /&gt;&lt;BR /&gt;Got lots of good answers.  THANKS.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2004 08:58:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pathetically-simple-diff-script-question/m-p/4858520#M713342</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2004-08-27T08:58:28Z</dc:date>
    </item>
  </channel>
</rss>

