<?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 script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601452#M855808</link>
    <description>Hi all,&lt;BR /&gt;again i need your help. i am currently working on some scripts, which should log with timestamps. i.e.:&lt;BR /&gt;-(snip)----------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;PATH=/usr/bin:/usr/sbin&lt;BR /&gt;TIMESTAMP=`date +"%d.%m.%E %H:%M:%S"&lt;BR /&gt;&lt;BR /&gt;echo "NOTE: $0 START AT ${TIMESTAMP}"&lt;BR /&gt;&lt;SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;&lt;BR /&gt;echo "NOTE: $0 END AT ${TIMESTAMP}"&lt;BR /&gt;-(snip)----------------&lt;BR /&gt;The output i want to see are different times between start of the script and end, like:&lt;BR /&gt;NOTE: &amp;lt;script&amp;gt; START AT 25.10.2001 19:09:03&lt;BR /&gt;NOTE: &amp;lt;script&amp;gt; END AT 25.10.2001 19:11:31&lt;BR /&gt;My problem is that the timestamps are absolutely equal. What am i doing wrong ?&lt;BR /&gt;TIA, RGDS, Holger&lt;/SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;</description>
    <pubDate>Thu, 25 Oct 2001 16:13:17 GMT</pubDate>
    <dc:creator>Holger Knoppik</dc:creator>
    <dc:date>2001-10-25T16:13:17Z</dc:date>
    <item>
      <title>script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601452#M855808</link>
      <description>Hi all,&lt;BR /&gt;again i need your help. i am currently working on some scripts, which should log with timestamps. i.e.:&lt;BR /&gt;-(snip)----------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;PATH=/usr/bin:/usr/sbin&lt;BR /&gt;TIMESTAMP=`date +"%d.%m.%E %H:%M:%S"&lt;BR /&gt;&lt;BR /&gt;echo "NOTE: $0 START AT ${TIMESTAMP}"&lt;BR /&gt;&lt;SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;&lt;BR /&gt;echo "NOTE: $0 END AT ${TIMESTAMP}"&lt;BR /&gt;-(snip)----------------&lt;BR /&gt;The output i want to see are different times between start of the script and end, like:&lt;BR /&gt;NOTE: &amp;lt;script&amp;gt; START AT 25.10.2001 19:09:03&lt;BR /&gt;NOTE: &amp;lt;script&amp;gt; END AT 25.10.2001 19:11:31&lt;BR /&gt;My problem is that the timestamps are absolutely equal. What am i doing wrong ?&lt;BR /&gt;TIA, RGDS, Holger&lt;/SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;</description>
      <pubDate>Thu, 25 Oct 2001 16:13:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601452#M855808</guid>
      <dc:creator>Holger Knoppik</dc:creator>
      <dc:date>2001-10-25T16:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601453#M855809</link>
      <description>you set your timestamp with the start time then never update it with the ending time&lt;BR /&gt;&lt;BR /&gt;TIMESTAMP=`date +"%d.%m.%E %H:%M:%S" &lt;BR /&gt;&lt;BR /&gt;echo "NOTE: $0 START AT ${TIMESTAMP}" &lt;BR /&gt;&lt;SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt; &lt;BR /&gt;&lt;BR /&gt;#add here:&lt;BR /&gt;#TIMESTAMP=`date +"%d.%m.%E %H:%M:%S" &lt;BR /&gt;echo "NOTE: $0 END AT ${TIMESTAMP}"&lt;/SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;</description>
      <pubDate>Thu, 25 Oct 2001 16:19:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601453#M855809</guid>
      <dc:creator>Curtis Larson_1</dc:creator>
      <dc:date>2001-10-25T16:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601454#M855810</link>
      <description>Use a TIMESTAMP and TIMESTAMP1, you can assign them the same date format, they will just get called at a different time. That should be an easy fix.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Oct 2001 16:19:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601454#M855810</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-10-25T16:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601455#M855811</link>
      <description>Here is what I mean!&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh &lt;BR /&gt;PATH=/usr/bin:/usr/sbin &lt;BR /&gt;TIMESTAMP=`date +"%d.%m.%E %H:%M:%S" &lt;BR /&gt;TIMESTAMP1=`date +"%d.%m.%E %H:%M:%S" &lt;BR /&gt;echo "NOTE: $0 START AT ${TIMESTAMP}" &lt;BR /&gt;&lt;SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt; &lt;BR /&gt;echo "NOTE: $0 END AT ${TIMESTAMP1}" &lt;BR /&gt;&lt;BR /&gt;That's what I would do, but there are a million ways to do it.&lt;/SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;</description>
      <pubDate>Thu, 25 Oct 2001 16:22:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601455#M855811</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-10-25T16:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601456#M855812</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You are using the displaying the valu of TIMESTAMP,&lt;BR /&gt;&lt;BR /&gt;calculate the value of timestamp after your commands&lt;BR /&gt;&lt;BR /&gt;Eg:&lt;BR /&gt;&lt;BR /&gt;TIMESTAMP=`date +"%d.%m.%E %H:%M:%S"&lt;BR /&gt;&lt;BR /&gt;echo "NOTE: $0 START AT ${TIMESTAMP}"&lt;BR /&gt;&lt;SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;&lt;BR /&gt;TIMESTAMP=`date +"%d.%m.%E %H:%M:%S"&lt;BR /&gt;echo "NOTE: $0 END AT ${TIMESTAMP}" &lt;BR /&gt;&lt;BR /&gt;This should fix it&lt;BR /&gt;&lt;BR /&gt;-Regards&lt;BR /&gt;Ramesh&lt;/SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;</description>
      <pubDate>Thu, 25 Oct 2001 16:22:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601456#M855812</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-10-25T16:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601457#M855813</link>
      <description>You can also do this ..&lt;BR /&gt;&lt;BR /&gt;echo NOTE: $0 START AT `date +"%d.%m.%E %H:%M:%S"`&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Oct 2001 16:26:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601457#M855813</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2001-10-25T16:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601458#M855814</link>
      <description>you can also use the timex command to find out&lt;BR /&gt;how long something takes to run.&lt;BR /&gt;&lt;BR /&gt;(eg) timex ls&lt;BR /&gt;&lt;BR /&gt;Eileen</description>
      <pubDate>Thu, 25 Oct 2001 16:27:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601458#M855814</guid>
      <dc:creator>Eileen Millen</dc:creator>
      <dc:date>2001-10-25T16:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601459#M855815</link>
      <description>Hi Holger,&lt;BR /&gt;&lt;BR /&gt;easy fix&lt;BR /&gt;Change the `` to '' to assign TIMESTAME to the command.&lt;BR /&gt;&lt;BR /&gt;TIMESTAMP='date +"%d.%m.%E %H:%M:%S"'&lt;BR /&gt;&lt;BR /&gt;Then in your echo command excute TIMESTAMP like:&lt;BR /&gt;&lt;BR /&gt;echo "start `$TIMESTAMP`"&lt;BR /&gt;&lt;BR /&gt;echo "end  `$TIMESTAMP`"&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;...jcd... &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Oct 2001 16:33:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601459#M855815</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-10-25T16:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601460#M855816</link>
      <description>Hi all, happy logger working on scripts again!&lt;BR /&gt;ONE problem, MANY solutions.&lt;BR /&gt;Craig, your suggestion sounds good, i tried it but unfortunately it didn't work. HMMMM, strange...&lt;BR /&gt;Eileen, attractive command. I will check it out again! Thanx everybody.&lt;BR /&gt;RGDS, Holger</description>
      <pubDate>Thu, 25 Oct 2001 17:04:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601460#M855816</guid>
      <dc:creator>Holger Knoppik</dc:creator>
      <dc:date>2001-10-25T17:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601461#M855817</link>
      <description>Holger,&lt;BR /&gt;I will have to look at my logic. I may have tried to answer the question before my second cup of coffee!</description>
      <pubDate>Thu, 25 Oct 2001 19:25:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601461#M855817</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-10-25T19:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601462#M855818</link>
      <description>As a few others have suggested move the TIMESTAMP1 variable down after the &lt;SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;,  section and it will work fine.  Oh sweet caffeine.&lt;/SOME_COMMANDS_THAT_TAKE_A_LITTLE_TIME_TO_FINISH&gt;</description>
      <pubDate>Thu, 25 Oct 2001 19:39:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2601462#M855818</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-10-25T19:39:07Z</dc:date>
    </item>
  </channel>
</rss>

