<?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: COM file to do DIFF in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938445#M35396</link>
    <description>&lt;BR /&gt;By the way, EACH together with PIPE allows to do something like:&lt;BR /&gt;&lt;BR /&gt;each *.com;-1 "pipe diff 'nt'/nooutput ; if $SEVERITY.eq.1 then delete/log 'nt';0"&lt;BR /&gt;&lt;BR /&gt;to delete the newest identical versions of files.</description>
    <pubDate>Tue, 06 Feb 2007 05:04:57 GMT</pubDate>
    <dc:creator>Joseph Huber_1</dc:creator>
    <dc:date>2007-02-06T05:04:57Z</dc:date>
    <item>
      <title>COM file to do DIFF</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938440#M35391</link>
      <description>Hey all,&lt;BR /&gt;&lt;BR /&gt;I'm new to DCL and OpenVMS and am trying to create a COM file that could do a DIFF between 2 versions of a file, for all the files in a directory.&lt;BR /&gt;&lt;BR /&gt;Is this possible?, or is there any code/script out there that does this already?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 05 Feb 2007 09:22:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938440#M35391</guid>
      <dc:creator>Jdavid</dc:creator>
      <dc:date>2007-02-05T09:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: COM file to do DIFF</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938441#M35392</link>
      <description>Jdavid,&lt;BR /&gt;&lt;BR /&gt;to begin with:&lt;BR /&gt;&lt;BR /&gt;Welcome to OpenVMS, and to the Forum!&lt;BR /&gt;&lt;BR /&gt;$ HELP LEX is your friend here.&lt;BR /&gt;&lt;BR /&gt;Try something along this line:&lt;BR /&gt;&lt;BR /&gt;$loop:&lt;BR /&gt;$ next = f$search("&lt;TO_SCAN_DIRECTORY&gt;")&lt;BR /&gt;$ if next .eqs. "" then goto done&lt;BR /&gt;$ diff 'next' /output = &lt;USE your="" phantasy=""&gt;&lt;BR /&gt;$ goto loop&lt;BR /&gt;$done:&lt;BR /&gt;&lt;BR /&gt;Well, you will have to do all error handling and other niceties yourself. I can eg thing of files with no lower version?&lt;BR /&gt;&lt;BR /&gt;Please use HELP: after 25 years it still is MY friend!&lt;BR /&gt;&lt;BR /&gt;Success.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;/USE&gt;&lt;/TO_SCAN_DIRECTORY&gt;</description>
      <pubDate>Mon, 05 Feb 2007 09:53:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938441#M35392</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-02-05T09:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: COM file to do DIFF</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938442#M35393</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;Welcome to the HP ITRC OpenVMS forum.&lt;BR /&gt;&lt;BR /&gt;Here is a script to get you going:&lt;BR /&gt;&lt;BR /&gt;$loop:&lt;BR /&gt;$file = f$search("*.tmp;0",1)&lt;BR /&gt;$if file.eqs."" then exit&lt;BR /&gt;$older = f$elem(0,";",file) + ";-1"&lt;BR /&gt;$!write sys$output file, " ", older&lt;BR /&gt;$if "".eqs. f$search(older,2) then goto loop&lt;BR /&gt;$diff 'file&lt;BR /&gt;$goto loop&lt;BR /&gt;&lt;BR /&gt;It does two 'fancy' things.&lt;BR /&gt;&lt;BR /&gt;1) it uses special file version naming.&lt;BR /&gt;To get only the highest version of what might be many files it uses ";0" thus the script does not need to match for other files with the same name but different version. And to see whether a diff is needed it searches for version ;-1 that being the next older version if present.&lt;BR /&gt;&lt;BR /&gt;2) it uses CONTEXT for F$SEARCH such that the main one used to loop through all the files, does nto get confused by the one to test for an older version&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;be sure to use VMS HELP on all construct in the exampel to fully comprehend.&lt;BR /&gt;&lt;BR /&gt;$HELP LEXI F$SEARCH&lt;BR /&gt;$HELP LEXT F$ELEMENT&lt;BR /&gt;:&lt;BR /&gt;&lt;BR /&gt;Enjoy DCL,&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Feb 2007 09:57:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938442#M35393</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-02-05T09:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: COM file to do DIFF</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938443#M35394</link>
      <description>Best would be to get one of the general "operate on a list of files" command-files from  some freeware archive. The best IMHO is EACH.COM (on dcl.openvms.org ? , if not, my copy is at &lt;A href="http://wwwvms.mppmu.mpg.de/util_root/com/each.com" target="_blank"&gt;http://wwwvms.mppmu.mpg.de/util_root/com/each.com&lt;/A&gt;  )&lt;BR /&gt;Then the stuff is rather easy:&lt;BR /&gt;  $ EACH *.*;0 "DIFFERENCE 'n'"&lt;BR /&gt;&lt;BR /&gt;But for a list of files, You probably want to do something with the files if they are (not-)identical:&lt;BR /&gt;  some examples how to do things after comparisons are in my command-files like &lt;BR /&gt; DELETE_IF_IDENTICAL.COM&lt;BR /&gt; COPY_IF_DIFFERENT.COM&lt;BR /&gt;on the http page above.</description>
      <pubDate>Mon, 05 Feb 2007 10:04:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938443#M35394</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2007-02-05T10:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: COM file to do DIFF</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938444#M35395</link>
      <description>Joseph is correct.&lt;BR /&gt;It is kinda nice to have a generic 'do this action for this list of files script'.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also, John Gillings pointed out to me that the following line is too quick &amp;amp; dirty in my script:&lt;BR /&gt;&lt;BR /&gt; $ older = F$PARSE(";-1",file) + ";-1" &lt;BR /&gt;&lt;BR /&gt;The problem is of course files with ";" somewhere else in the name. And for other cases perhaps the usage of "." as version indicator. I frequently do things like: delete x.tmp.&lt;BR /&gt;&lt;BR /&gt;The proper way to solve this with learning as little as possible about file name parsing yourself is:&lt;BR /&gt;&lt;BR /&gt;$ older = F$PARSE(";-1",file) &lt;BR /&gt;&lt;BR /&gt;Correct. And shorter :-)&lt;BR /&gt;&lt;BR /&gt;Runner up might be:&lt;BR /&gt;&lt;BR /&gt;older =  file - f$parse(file,,,"version") + ";-1"&lt;BR /&gt;&lt;BR /&gt;I only show that to show the power of string substractions and appends. The straight parse is better.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Feb 2007 22:10:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938444#M35395</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-02-05T22:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: COM file to do DIFF</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938445#M35396</link>
      <description>&lt;BR /&gt;By the way, EACH together with PIPE allows to do something like:&lt;BR /&gt;&lt;BR /&gt;each *.com;-1 "pipe diff 'nt'/nooutput ; if $SEVERITY.eq.1 then delete/log 'nt';0"&lt;BR /&gt;&lt;BR /&gt;to delete the newest identical versions of files.</description>
      <pubDate>Tue, 06 Feb 2007 05:04:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/com-file-to-do-diff/m-p/3938445#M35396</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2007-02-06T05:04:57Z</dc:date>
    </item>
  </channel>
</rss>

