<?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: Script Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659737#M47966</link>
    <description>That's a neat idea Andreas!  James, good add-on about adjusting for your timezone.  I did a little testing and found yesterday's date with:&lt;BR /&gt;TZ=EST+5 date&lt;BR /&gt;&lt;BR /&gt;One may want to allow for Daylight Savings Time.  In the case of Eastern US you could check the results of "date +%Z".  If EDT you could then use:&lt;BR /&gt;TZ=EDT-20 date&lt;BR /&gt;or for yesterday:&lt;BR /&gt;TZ=EDT+4 date&lt;BR /&gt;&lt;BR /&gt;Actually, it didn't matter if I use EST or EDT as long as the numerical offset was adjusted.&lt;BR /&gt;&lt;BR /&gt;I didn't test for dates and times during the time change between EST and EDT (nor vice versa).  I wonder what the results would be?&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
    <pubDate>Wed, 06 Feb 2002 15:16:44 GMT</pubDate>
    <dc:creator>Darrell Allen</dc:creator>
    <dc:date>2002-02-06T15:16:44Z</dc:date>
    <item>
      <title>Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659730#M47959</link>
      <description>I am using 'ex' within a script. I read in a file and use 'ex' to cut out what I need. My question is, I have this command as a variable&lt;BR /&gt;date '+%m\/%d\/%y' and my output looks like&lt;BR /&gt;02\/06\/02.&lt;BR /&gt;&lt;BR /&gt;How can I use this same method to get tomorrows date in the form 02/07/02. I dont need the back slash in 'tomorrows date' output.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bob</description>
      <pubDate>Wed, 06 Feb 2002 13:52:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659730#M47959</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2002-02-06T13:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659731#M47960</link>
      <description>running date +%m%d%y gives me 020602.&lt;BR /&gt;Is that what you are after?&lt;BR /&gt;Remove the \/ from your script and see if that helps.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Feb 2002 13:56:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659731#M47960</guid>
      <dc:creator>melvyn burnard</dc:creator>
      <dc:date>2002-02-06T13:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659732#M47961</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;try this&lt;BR /&gt;x=`date +%m"/"%d"/"%y`;echo $x&lt;BR /&gt;&lt;BR /&gt;Hope this help&lt;BR /&gt;jose</description>
      <pubDate>Wed, 06 Feb 2002 13:57:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659732#M47961</guid>
      <dc:creator>Kurtkarl</dc:creator>
      <dc:date>2002-02-06T13:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659733#M47962</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;to get next day you could do:&lt;BR /&gt;&lt;BR /&gt;TZ=GMT+24 date +%m/%d/%y&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 06 Feb 2002 13:57:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659733#M47962</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2002-02-06T13:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659734#M47963</link>
      <description>Hi Bob,&lt;BR /&gt;&lt;BR /&gt;A. Clay Stephenson has contributed the attached script on a number of occasions.  It can be used to convert to and from Julian dates which makes date math simple.  To get tomorrow's date in the form mmddyy:&lt;BR /&gt;&lt;BR /&gt;caljd.sh `caljd.sh -n1` | sed 's/ //g' | cut -c1-4,7-8&lt;BR /&gt;&lt;BR /&gt;If you do want / delimited:&lt;BR /&gt;&lt;BR /&gt;caljd.sh `caljd.sh -n1` | sed 's/ /\//g' | cut -c1-6,9-10&lt;BR /&gt;&lt;BR /&gt;All the credit to Clay.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 06 Feb 2002 14:25:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659734#M47963</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-02-06T14:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659735#M47964</link>
      <description>I run the date command and put it into a variable, resulting in the output you want. Here is what I do.&lt;BR /&gt;&lt;BR /&gt;DATE=`date +%m/%d/%y`&lt;BR /&gt;&lt;BR /&gt;GL,&lt;BR /&gt;C</description>
      <pubDate>Wed, 06 Feb 2002 14:29:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659735#M47964</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2002-02-06T14:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659736#M47965</link>
      <description>Hi Robert:&lt;BR /&gt;&lt;BR /&gt;I have used the trick noted by Andreas, too.  However, if you want the date *exactly* 24-hours from your current date; that is, exactly the *next* day, you need to account for the difference you are from UTC.&lt;BR /&gt;&lt;BR /&gt;Thus, in my US Eastern time zone, I am 5 hours earlier than UTC.  Thus, if I want tomorrow's date I specify (24 - 5 or 19 hours from now):&lt;BR /&gt;&lt;BR /&gt;# TZ=EST-19 date&lt;BR /&gt;&lt;BR /&gt;Note that this only works for offsets less than 24-hours so these tricks work only for one day offsets.&lt;BR /&gt;&lt;BR /&gt;Note too, the blank after the TZ variable is set.  There is no semicolon either!  This syntax sets the TZ variable *only* for this command line.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 06 Feb 2002 14:44:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659736#M47965</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-02-06T14:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659737#M47966</link>
      <description>That's a neat idea Andreas!  James, good add-on about adjusting for your timezone.  I did a little testing and found yesterday's date with:&lt;BR /&gt;TZ=EST+5 date&lt;BR /&gt;&lt;BR /&gt;One may want to allow for Daylight Savings Time.  In the case of Eastern US you could check the results of "date +%Z".  If EDT you could then use:&lt;BR /&gt;TZ=EDT-20 date&lt;BR /&gt;or for yesterday:&lt;BR /&gt;TZ=EDT+4 date&lt;BR /&gt;&lt;BR /&gt;Actually, it didn't matter if I use EST or EDT as long as the numerical offset was adjusted.&lt;BR /&gt;&lt;BR /&gt;I didn't test for dates and times during the time change between EST and EDT (nor vice versa).  I wonder what the results would be?&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 06 Feb 2002 15:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659737#M47966</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-02-06T15:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659738#M47967</link>
      <description>Hi Darrell:&lt;BR /&gt;&lt;BR /&gt;Our European friends living around the Prime Meridian are the "lucky" ones who can use +-24 hours to exactly compute yesterday or tommorrow including the correct time.&lt;BR /&gt;&lt;BR /&gt;If you look at the man pages for environ (5) you will note that offset is the value that must be added to local time to arrive at UTC (GMT).  Offset takes the format hh[:mm[:ss]]&lt;BR /&gt;where (hh)is any value from 0 through 23.  The optional minutes (mm) and seconds (ss) fields are a value from 0 through 59.  The hour field is required.  If offset is preceded by a -, the time zone is east of the Prime Meridian.  A + preceding offset indicates that the time&lt;BR /&gt;one is west of the Prime Meridian.&lt;BR /&gt;&lt;BR /&gt;Notice, for example that while it is now 1100 hours on February 6 in the Eastern US, you cannot produce a date *and time* exactly 24-hours ago.  To affect this, the computation would need to offset 29 hours (24+5), an invalid offset.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 06 Feb 2002 16:03:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659738#M47967</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-02-06T16:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659739#M47968</link>
      <description>Thanks, everyone. Some good suggestions.</description>
      <pubDate>Wed, 06 Feb 2002 16:21:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659739#M47968</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2002-02-06T16:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659740#M47969</link>
      <description>A retraction...&lt;BR /&gt;&lt;BR /&gt;Regarding:  TZ=EST+5 date&lt;BR /&gt;&lt;BR /&gt;After seeing another post today, I looked back at this one and noticed Jim's last comment.  So I tried it again.&lt;BR /&gt;&lt;BR /&gt;I swear I tested using EST+5 yesterday before posting but now it doesn't work!  So, even though I thought it worked then, it definitely does not work now.&lt;BR /&gt;&lt;BR /&gt;I gotta lay off the cafeine (or maybe I need more)!  My apologies.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Fri, 08 Feb 2002 20:37:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2659740#M47969</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-02-08T20:37:23Z</dc:date>
    </item>
  </channel>
</rss>

