<?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 command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055243#M137404</link>
    <description>okay, I ran that command with perl installed on the machine.&lt;BR /&gt;But I have another HP machine which doesnt have perl installed and this command didnt work there as you said.&lt;BR /&gt;Now I have a script which does the same thing.&lt;BR /&gt;But that only works for SUN.&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;FILE=/temp/abcd.time&lt;BR /&gt;&lt;BR /&gt;touch $FILE&lt;BR /&gt;&lt;BR /&gt;(&lt;BR /&gt; echo 10 o 8 i&lt;BR /&gt; echo $FILE | /usr/bin/cpio -o -H odc    2&amp;gt;/dev/null | /usr/bin/cut -c50-59&lt;BR /&gt; echo p&lt;BR /&gt;) | /usr/bin/dc&lt;BR /&gt;&lt;BR /&gt;/usr/bin/rm -f /tmp/abcd.time &lt;BR /&gt;&lt;BR /&gt;For HP it gives the error as "Empty Stack".&lt;BR /&gt;How do I get over with this problem.&lt;BR /&gt;Any suggestions would help.&lt;BR /&gt;Thanks.</description>
    <pubDate>Fri, 22 Aug 2003 22:54:46 GMT</pubDate>
    <dc:creator>Adi_7</dc:creator>
    <dc:date>2003-08-22T22:54:46Z</dc:date>
    <item>
      <title>Date command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055240#M137401</link>
      <description>Do we have any command in HP that gives the number of seconds elapsed from 1st Jan 1970?&lt;BR /&gt;like "date +%s" in linux.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 22 Aug 2003 21:41:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055240#M137401</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-22T21:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Date command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055241#M137402</link>
      <description>These should work if you have perl.&lt;BR /&gt;&lt;BR /&gt;$ perl -e 'print time;'&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;$ perl -e 'print time,"\n"'&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Aug 2003 22:16:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055241#M137402</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2003-08-22T22:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055242#M137403</link>
      <description>Thanks so much.&lt;BR /&gt;It worked!!</description>
      <pubDate>Fri, 22 Aug 2003 22:20:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055242#M137403</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-22T22:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055243#M137404</link>
      <description>okay, I ran that command with perl installed on the machine.&lt;BR /&gt;But I have another HP machine which doesnt have perl installed and this command didnt work there as you said.&lt;BR /&gt;Now I have a script which does the same thing.&lt;BR /&gt;But that only works for SUN.&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;FILE=/temp/abcd.time&lt;BR /&gt;&lt;BR /&gt;touch $FILE&lt;BR /&gt;&lt;BR /&gt;(&lt;BR /&gt; echo 10 o 8 i&lt;BR /&gt; echo $FILE | /usr/bin/cpio -o -H odc    2&amp;gt;/dev/null | /usr/bin/cut -c50-59&lt;BR /&gt; echo p&lt;BR /&gt;) | /usr/bin/dc&lt;BR /&gt;&lt;BR /&gt;/usr/bin/rm -f /tmp/abcd.time &lt;BR /&gt;&lt;BR /&gt;For HP it gives the error as "Empty Stack".&lt;BR /&gt;How do I get over with this problem.&lt;BR /&gt;Any suggestions would help.&lt;BR /&gt;Thanks.</description>
      <pubDate>Fri, 22 Aug 2003 22:54:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055243#M137404</guid>
      <dc:creator>Adi_7</dc:creator>
      <dc:date>2003-08-22T22:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Date command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055244#M137405</link>
      <description>I guess the first question to ask is "why do you&lt;BR /&gt;want to do this"? Perhaps there's an easier&lt;BR /&gt;route to go.&lt;BR /&gt;&lt;BR /&gt;It is relatively straightforward and portable to&lt;BR /&gt;write a short C program to get the time in the&lt;BR /&gt;format you want:&lt;BR /&gt;&lt;BR /&gt;#include &lt;TIME.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main() {&lt;BR /&gt;  printf("%d\n", time(NULL));&lt;BR /&gt;  return(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Compile this and install it on the machine as&lt;BR /&gt;/usr/local/bin/gettimestamp or somesuch.&lt;BR /&gt;Then just call it from your script.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;/STDIO.H&gt;&lt;/TIME.H&gt;</description>
      <pubDate>Fri, 22 Aug 2003 23:54:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055244#M137405</guid>
      <dc:creator>Gregory Fruth</dc:creator>
      <dc:date>2003-08-22T23:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055245#M137406</link>
      <description>Hi Adi,&lt;BR /&gt;&lt;BR /&gt;you can modify your script to something like this on hpux:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;FILE=/tmp/abcd.time&lt;BR /&gt;touch $FILE&lt;BR /&gt;HEADER=$(echo $FILE | /usr/bin/cpio -o -c 2&amp;gt;/dev/null)&lt;BR /&gt;(&lt;BR /&gt;echo 10 o 8 i&lt;BR /&gt;echo "$HEADER" | /usr/bin/cut -c50-59&lt;BR /&gt;echo p&lt;BR /&gt;) | /usr/bin/dc&lt;BR /&gt;/usr/bin/rm -f /tmp/abcd.time&lt;BR /&gt;&lt;BR /&gt;# end of script&lt;BR /&gt;&lt;BR /&gt;On my system it gives this result:&lt;BR /&gt;&lt;BR /&gt;1061711793&lt;BR /&gt;&lt;BR /&gt;which can be converted it into something more human this way:&lt;BR /&gt;# SECS=1061711793&lt;BR /&gt;# echo 0d${SECS}=Y|adb&lt;BR /&gt; 2003 Aug 24 09:56:33&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Sun, 24 Aug 2003 07:07:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055245#M137406</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-08-24T07:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055246#M137407</link>
      <description>If this is part of a large script(ing project) why not consider installing perl on all your systems? Than you have portable scripts by default :)&lt;BR /&gt;&lt;BR /&gt;For HP-UX, you can get precompiled binaries from the HP Porting Centers (&lt;A href="http://hpux.connect.org.uk/" target="_blank"&gt;http://hpux.connect.org.uk/&lt;/A&gt; amongst many) or my HP ITRC site (&lt;A href="http://www.cmve.net/~merijn" target="_blank"&gt;http://www.cmve.net/~merijn&lt;/A&gt; or &lt;A href="https://www.beepz.com/personal/merijn)." target="_blank"&gt;https://www.beepz.com/personal/merijn).&lt;/A&gt; For Sun (and other OS's) links to precompiled binaries can be found here (&lt;A href="http://www.cpan.org/ports/)" target="_blank"&gt;http://www.cpan.org/ports/)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If possible, I'd advise you to take a recent port, like 5.8.0 (current latest stable), because that assures all examples posted here to actually work.&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Sun, 24 Aug 2003 08:48:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-command/m-p/3055246#M137407</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-08-24T08:48:20Z</dc:date>
    </item>
  </channel>
</rss>

