<?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: Find every Thursday in a year? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398494#M200285</link>
    <description>Hi Steve:&lt;BR /&gt;&lt;BR /&gt;To be ultra nit-picky, please make these changes:&lt;BR /&gt;&lt;BR /&gt;typeset OFFSET=$((${WKDAY} - ${WDAY1}))&lt;BR /&gt;to&lt;BR /&gt;typeset -i OFFSET=$((${WKDAY} - ${WDAY1}))&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;typeset JD=$((${JDAY1} + ${OFFSET}))&lt;BR /&gt;to&lt;BR /&gt;typeset -i JD=$((${JDAY1} + ${OFFSET}))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The script will work just fine w/o these changes but I tend to be a rigorous kind of guy. I didn't notice anything else.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 12 Oct 2004 14:20:38 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-10-12T14:20:38Z</dc:date>
    <item>
      <title>Find every Thursday in a year?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398491#M200282</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Does anybody know how to get date or cal to show every Thursday in a year?&lt;BR /&gt;&lt;BR /&gt;Thanks, &lt;BR /&gt;Steve</description>
      <pubDate>Tue, 12 Oct 2004 13:55:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398491#M200282</guid>
      <dc:creator>Steve Start</dc:creator>
      <dc:date>2004-10-12T13:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find every Thursday in a year?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398492#M200283</link>
      <description>This tool can do it:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hpux.ws/merijn/caljd-2.23.sh" target="_blank"&gt;http://www.hpux.ws/merijn/caljd-2.23.sh&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hpux.ws/merijn/caljd-2.2.pl" target="_blank"&gt;http://www.hpux.ws/merijn/caljd-2.2.pl&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You'll need to read the notes to learn how to give the tool input.&lt;BR /&gt;&lt;BR /&gt;A. Clay's date magic tool!&lt;BR /&gt;&lt;BR /&gt;It can do all kinds of date magic. Bookmark it, its updated periodically. I've ported it to Linux(shell change).&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 12 Oct 2004 13:58:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398492#M200283</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-10-12T13:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find every Thursday in a year?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398493#M200284</link>
      <description>When combined with the above mentioned caljd.sh (with caljd.sh installed somewhere in your PATH) this untested and typed "on the fly" script should do it.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset PROG=${0##*/}&lt;BR /&gt;&lt;BR /&gt;usage()&lt;BR /&gt;{&lt;BR /&gt;  echo "\n${PROG}: year wkday\n" &amp;gt;&amp;amp;2&lt;BR /&gt;  echo "year - 4-digit year" &amp;gt;&amp;amp;2&lt;BR /&gt;  echo "wkday: 0 - Sun, 1 - Mon, ... 6 - Sat\n" &amp;gt;&amp;amp;2&lt;BR /&gt;  return 255&lt;BR /&gt;} # usage&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;typeset -i STAT=0&lt;BR /&gt;if [[ ${#} -ge 2 ]]&lt;BR /&gt;  then&lt;BR /&gt;    typeset -i YR=${1}&lt;BR /&gt;    typeset -i WKDAY=${2}&lt;BR /&gt;    shift 2&lt;BR /&gt;    typeset -i JDAY1=$(caljd.sh 1 1 ${YR})&lt;BR /&gt;    typeset -i WDAY1=$(caljd.sh -w ${JDAY1})&lt;BR /&gt;    typeset OFFSET=$((${WKDAY} - ${WDAY1}))&lt;BR /&gt;    if [[ ${OFFSET} -lt 0 ]]&lt;BR /&gt;      then&lt;BR /&gt;        ((OFFSET += 7))&lt;BR /&gt;      fi&lt;BR /&gt;    typeset -Z4 YEAR=${YR}&lt;BR /&gt;    typeset -Z2 MONTH=0 &lt;BR /&gt;    typeset -Z2 DAY=0&lt;BR /&gt;    typeset JD=$((${JDAY1} + ${OFFSET}))&lt;BR /&gt;    while [[ ${YEAR} -eq ${YR} ]]&lt;BR /&gt;      do&lt;BR /&gt;        caljd.sh ${JD} | read MONTH DAY YEAR&lt;BR /&gt;        if [[ ${YEAR} -eq ${YR} ]]&lt;BR /&gt;          then&lt;BR /&gt;            echo "${MONTH}/${DAY}/${YEAR}"&lt;BR /&gt;          fi&lt;BR /&gt;        ((JD += 7))&lt;BR /&gt;      done&lt;BR /&gt;  else&lt;BR /&gt;    usage  &lt;BR /&gt;    STAT=${?}&lt;BR /&gt;  fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Invoke it like this:&lt;BR /&gt;weekday.sh 2005 4&lt;BR /&gt;&lt;BR /&gt;The trick is to find the 1st desired weekday in the year and then display every 7th day until the year changes. If I ain't done gone and typed something wrong, this here ought to do it for you.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Oct 2004 14:07:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398493#M200284</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-10-12T14:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find every Thursday in a year?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398494#M200285</link>
      <description>Hi Steve:&lt;BR /&gt;&lt;BR /&gt;To be ultra nit-picky, please make these changes:&lt;BR /&gt;&lt;BR /&gt;typeset OFFSET=$((${WKDAY} - ${WDAY1}))&lt;BR /&gt;to&lt;BR /&gt;typeset -i OFFSET=$((${WKDAY} - ${WDAY1}))&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;typeset JD=$((${JDAY1} + ${OFFSET}))&lt;BR /&gt;to&lt;BR /&gt;typeset -i JD=$((${JDAY1} + ${OFFSET}))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The script will work just fine w/o these changes but I tend to be a rigorous kind of guy. I didn't notice anything else.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Oct 2004 14:20:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398494#M200285</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-10-12T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find every Thursday in a year?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398495#M200286</link>
      <description>Thanks, that worked great.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Oct 2004 15:40:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398495#M200286</guid>
      <dc:creator>Steve Start</dc:creator>
      <dc:date>2004-10-12T15:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find every Thursday in a year?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398496#M200287</link>
      <description>We can do with cal easily as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;# Input year&lt;BR /&gt;year=${1:-2004}&lt;BR /&gt;month=1&lt;BR /&gt;&lt;BR /&gt;while [[ $month -le 12 ]]&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt; cal $month $year | head -1&lt;BR /&gt; cal $month $year | grep -v $year | cut -b 12-14&lt;BR /&gt; let month=month+1&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;It will give you informations there.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Oct 2004 16:09:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-every-thursday-in-a-year/m-p/3398496#M200287</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-12T16:09:52Z</dc:date>
    </item>
  </channel>
</rss>

