<?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: Date Calculations in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767526#M895299</link>
    <description>Derek, &lt;BR /&gt;&lt;BR /&gt;I don't see anything wrong but I just typed this guy in 'off the cuff' so I could have very well missed a pesky '{' or '(' but it's not jumping out at me.&lt;BR /&gt;&lt;BR /&gt;You mention that you did a search. As a guess, are you using a version &amp;lt; 2.1? The -c, -i, and -I options to allow it to recognize dates like 1-January-2002 were not added until Version 2.1. I hope it's that; otherwise, it's my advanced one-finger hunt-and-peck typing technique but again I don't see that in my earlier posting.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
    <pubDate>Thu, 18 Jul 2002 19:31:18 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-07-18T19:31:18Z</dc:date>
    <item>
      <title>Date Calculations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767522#M895295</link>
      <description>Hello Forumers,&lt;BR /&gt;&lt;BR /&gt;Thanks to some assistance from you guys, I have been able to join some files to produce output data like this:&lt;BR /&gt;&lt;BR /&gt;1009 1-Jan-1999 12-Jun-1999&lt;BR /&gt;2063 24-Oct-2001 12-Dec-2001&lt;BR /&gt;3741 12-Feb-2002 ----------&lt;BR /&gt;&lt;BR /&gt;The first field is a unique ID No. The second field is a start date and the third field is an ending date. What I need to do is find those lines which have the dashed ending date field. They are still active. I think I can do that but the hard part is to then determine if the starting date is about to expire. I want to issue a warning 1 week before the 90 day period is up. Basically, I need something that will work if today's date - starting date &amp;gt;= 83 days.  I want to output the ID no. and the days left on one line.&lt;BR /&gt;&lt;BR /&gt;I am trying to replace several C programs with scripts.  I've looked at the date command but I am concerned about the calculations where the year changes.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any and all help,&lt;BR /&gt;Derek Card</description>
      <pubDate>Thu, 18 Jul 2002 18:34:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767522#M895295</guid>
      <dc:creator>Derek Card</dc:creator>
      <dc:date>2002-07-18T18:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date Calculations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767523#M895296</link>
      <description>Hi Derek:&lt;BR /&gt;&lt;BR /&gt;Whenever I see date calculations, I perk up. This actually seems easy with my date sledgehammer, caljd.sh.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;TODAY=$(caljd.sh)&lt;BR /&gt;MAXDAYS=83&lt;BR /&gt;while read ID START_DATE END_DATE&lt;BR /&gt;  do&lt;BR /&gt;    X=$(echo "${END_DATE}" | tr -d "-")&lt;BR /&gt;    if [[ -z "${X}" ]]&lt;BR /&gt;      then&lt;BR /&gt;        JD_START_DATE=$(caljd.sh -e -i -S '-' -c ${START_DATE})&lt;BR /&gt;        DAYS=$((${TODAY} - ${JD_START_DATE}))&lt;BR /&gt;        if [[ ${DAYS} -ge ${MAXDAYS} ]]&lt;BR /&gt;          then&lt;BR /&gt;            echo "${ID}\t${DAYS}"&lt;BR /&gt;          fi&lt;BR /&gt;      fi&lt;BR /&gt;  done&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;--------------------------------------&lt;BR /&gt;&lt;BR /&gt;You would use it like:&lt;BR /&gt;expire.sh &amp;lt; myfile &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;If I haven't made a typo that should do it.&lt;BR /&gt;&lt;BR /&gt;Here's caljd.sh. caljd.sh -u will give full usage including a number of examples.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 18:45:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767523#M895296</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-18T18:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Date Calculations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767524#M895297</link>
      <description>Hi again:&lt;BR /&gt;&lt;BR /&gt;You can also use the Perl version, caljd.pl. The arguments are exactly the same. In looking over my earlier example, I realized that you could put a grep "--------" in front of it and make it faster.&lt;BR /&gt;&lt;BR /&gt;Here's caljd.pl.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 19:02:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767524#M895297</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-18T19:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date Calculations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767525#M895298</link>
      <description>Hi Clay,&lt;BR /&gt;&lt;BR /&gt;Thanks but there seems to be something wrong with your script. I had already searched and found caljd.sh.  I keep getting an error message: /usr/bin/caljd.sh Invalid args.  Any ideas?&lt;BR /&gt;&lt;BR /&gt;Derek</description>
      <pubDate>Thu, 18 Jul 2002 19:24:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767525#M895298</guid>
      <dc:creator>Derek Card</dc:creator>
      <dc:date>2002-07-18T19:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Date Calculations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767526#M895299</link>
      <description>Derek, &lt;BR /&gt;&lt;BR /&gt;I don't see anything wrong but I just typed this guy in 'off the cuff' so I could have very well missed a pesky '{' or '(' but it's not jumping out at me.&lt;BR /&gt;&lt;BR /&gt;You mention that you did a search. As a guess, are you using a version &amp;lt; 2.1? The -c, -i, and -I options to allow it to recognize dates like 1-January-2002 were not added until Version 2.1. I hope it's that; otherwise, it's my advanced one-finger hunt-and-peck typing technique but again I don't see that in my earlier posting.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Thu, 18 Jul 2002 19:31:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767526#M895299</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-18T19:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date Calculations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767527#M895300</link>
      <description>Clay,&lt;BR /&gt;&lt;BR /&gt;I don't see any typos either. That is usual, you almost always have at least one. :-) Maybe you are just getting more sneaky.&lt;BR /&gt;&lt;BR /&gt;:-)&lt;BR /&gt;Marty</description>
      <pubDate>Thu, 18 Jul 2002 19:44:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767527#M895300</guid>
      <dc:creator>Martin Johnson</dc:creator>
      <dc:date>2002-07-18T19:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date Calculations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767528#M895301</link>
      <description>Clay, dude you are good. I had downloaded an earlier version (2.05). As soon as I used the version that you attached, the script worked like a champ!&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Derek</description>
      <pubDate>Thu, 18 Jul 2002 19:55:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-calculations/m-p/2767528#M895301</guid>
      <dc:creator>Derek Card</dc:creator>
      <dc:date>2002-07-18T19:55:27Z</dc:date>
    </item>
  </channel>
</rss>

