<?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: file date verses current date in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879441#M719440</link>
    <description>great - I'm glad to hear that.  I started scripting about a year  ago - just a little after I started using Unix/Linux.  &lt;BR /&gt;If you're frustrated I can recomment 2 books that have helped me tremendously:&lt;BR /&gt;&lt;BR /&gt;Korn Shell Programming&lt;BR /&gt;by O'Brien, Pitts&lt;BR /&gt;and &lt;BR /&gt;sed &amp;amp; awk&lt;BR /&gt;O'Reilly</description>
    <pubDate>Fri, 10 Jan 2003 19:22:17 GMT</pubDate>
    <dc:creator>John Meissner</dc:creator>
    <dc:date>2003-01-10T19:22:17Z</dc:date>
    <item>
      <title>file date verses current date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879437#M719436</link>
      <description>I haven't done many (hardly any) scripts and am getting frustrated with what should be an easy one.  Can some of you more experienced script writes tell me what I'm doing wrong?  What I am doing is trying to compare a file date with the current date.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;CMDATE= date +'%b'&lt;BR /&gt;CDDATE= date +'%e'&lt;BR /&gt;FMDATE= ls -l TUXLOG.061002 | cut -c 46-48&lt;BR /&gt;FDDATE= ls -l TUXLOG.061002 | cut -c 50-52&lt;BR /&gt;print "Month: "$CMDATE "Day: "$CDDATE&lt;BR /&gt;print "Month: "$FMDATE "Day: "$FDDATE&lt;BR /&gt;if [[ "$CMDATE" -eq "$FMDATE" ]]&lt;BR /&gt;then&lt;BR /&gt;        if [[ "$CDDATE" -eq "$FDDATE" ]]&lt;BR /&gt;        then&lt;BR /&gt;        print "They match"&lt;BR /&gt;        else&lt;BR /&gt;        print "Check Date"&lt;BR /&gt;        fi&lt;BR /&gt;else&lt;BR /&gt;print "Check Date"&lt;BR /&gt;fi&lt;BR /&gt;exit</description>
      <pubDate>Fri, 10 Jan 2003 18:55:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879437#M719436</guid>
      <dc:creator>Peter Lyons_1</dc:creator>
      <dc:date>2003-01-10T18:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: file date verses current date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879438#M719437</link>
      <description>d=$(date | awk '{print $2,$3}')&lt;BR /&gt;file=filename&lt;BR /&gt;d2=$(ls -la $:file | awk '{print $6,$7}')&lt;BR /&gt;if [ "$d" = "$d2" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "they match"&lt;BR /&gt;elif [ "$d" != "$d2" ]&lt;BR /&gt;then&lt;BR /&gt;echo "Check date"&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Jan 2003 19:04:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879438#M719437</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-01-10T19:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: file date verses current date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879439#M719438</link>
      <description>you'll have to excuse my fat fingers.....&lt;BR /&gt;d2=$(ls -la $:file | awk '{print $6,$7}') &lt;BR /&gt;&lt;BR /&gt;should read d2=$(ls -la $file | awk '{print $6,$7}') &lt;BR /&gt;&lt;BR /&gt;I put a : in accidently</description>
      <pubDate>Fri, 10 Jan 2003 19:08:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879439#M719438</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-01-10T19:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: file date verses current date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879440#M719439</link>
      <description>Thanks that did the trick!</description>
      <pubDate>Fri, 10 Jan 2003 19:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879440#M719439</guid>
      <dc:creator>Peter Lyons_1</dc:creator>
      <dc:date>2003-01-10T19:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: file date verses current date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879441#M719440</link>
      <description>great - I'm glad to hear that.  I started scripting about a year  ago - just a little after I started using Unix/Linux.  &lt;BR /&gt;If you're frustrated I can recomment 2 books that have helped me tremendously:&lt;BR /&gt;&lt;BR /&gt;Korn Shell Programming&lt;BR /&gt;by O'Brien, Pitts&lt;BR /&gt;and &lt;BR /&gt;sed &amp;amp; awk&lt;BR /&gt;O'Reilly</description>
      <pubDate>Fri, 10 Jan 2003 19:22:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-date-verses-current-date/m-p/2879441#M719440</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-01-10T19:22:17Z</dc:date>
    </item>
  </channel>
</rss>

