<?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 HP-UX shell or OE access to epoch secs in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838983#M98839</link>
    <description>&lt;!--!*#--&gt;Hello,&lt;BR /&gt;  &lt;BR /&gt;the GNU date command offers among many other useful extensions the %s flag that provides epoch seconds.&lt;BR /&gt;I have several shell scripts to be run on hpux that require them and make a fork to Perl to whenever they need to fetch them.&lt;BR /&gt;But I always feel that the whole script should better be written in Perl anew whenever I have more than 3 awk or 1 Perl calls in it.&lt;BR /&gt;I wonder if maybe HP have hidden somewhere a shell call (or env var similar to $SECONDS) to get them more "directly"?&lt;BR /&gt;  &lt;BR /&gt;  &lt;BR /&gt;$ uname -sr; rpm -qf $(which date); date +%s; perl -le print\ time&lt;BR /&gt;Linux 2.6.9-1.667smp&lt;BR /&gt;coreutils-5.2.1-31&lt;BR /&gt;1155020000&lt;BR /&gt;1155020000&lt;BR /&gt;</description>
    <pubDate>Tue, 08 Aug 2006 01:55:46 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2006-08-08T01:55:46Z</dc:date>
    <item>
      <title>HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838983#M98839</link>
      <description>&lt;!--!*#--&gt;Hello,&lt;BR /&gt;  &lt;BR /&gt;the GNU date command offers among many other useful extensions the %s flag that provides epoch seconds.&lt;BR /&gt;I have several shell scripts to be run on hpux that require them and make a fork to Perl to whenever they need to fetch them.&lt;BR /&gt;But I always feel that the whole script should better be written in Perl anew whenever I have more than 3 awk or 1 Perl calls in it.&lt;BR /&gt;I wonder if maybe HP have hidden somewhere a shell call (or env var similar to $SECONDS) to get them more "directly"?&lt;BR /&gt;  &lt;BR /&gt;  &lt;BR /&gt;$ uname -sr; rpm -qf $(which date); date +%s; perl -le print\ time&lt;BR /&gt;Linux 2.6.9-1.667smp&lt;BR /&gt;coreutils-5.2.1-31&lt;BR /&gt;1155020000&lt;BR /&gt;1155020000&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Aug 2006 01:55:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838983#M98839</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2006-08-08T01:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838984#M98840</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;while changing a (shell)-script implementation to perl is a good idea in general, it clearly depends on the length and structure of the task of the script and the amount of time availble to port it.&lt;BR /&gt;&lt;BR /&gt;Take a look at your script and analyze what commands are called which are not builtins:&lt;BR /&gt;If there are few the 'perlification' should be (enough perl knowhow granted) easy.&lt;BR /&gt;If there are many external command calls, the benefit of changing&lt;BR /&gt;a=$(command1)&lt;BR /&gt;to&lt;BR /&gt;open (FD,"command|");&lt;BR /&gt;while(&lt;FD&gt;)..&lt;BR /&gt;will be close to zero.&lt;BR /&gt;&lt;BR /&gt;If your are in a phase of porting a script to other UNIXes or even to WIN$, that approach should be really considered.&lt;BR /&gt;Just for the sake of eliminating a few system() calls it is mostly an oversized effort.&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;&lt;BR /&gt;PS: I don't know of any 'hidden' calls or option to one in HP-UX as a substitute for&lt;BR /&gt;perl -le 'print time;' .&lt;/FD&gt;</description>
      <pubDate>Tue, 08 Aug 2006 04:38:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838984#M98840</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-08-08T04:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838985#M98841</link>
      <description>Hi Ralph:&lt;BR /&gt;&lt;BR /&gt;I agree with Peter's comments.  Depending upon the number and number of times a script has to fork 'awk', 'sed', 'perl' or for that matter any external command, can often be reduced, improving the overall efficiency of the code.  &lt;BR /&gt;&lt;BR /&gt;I have seen too many shell scripts use 'cat' to read a file only to pipe the output to 'sed' or 'awk'.  A collorary is using 'cat' to pipe into a shell 'while read...' instead of redirecting the input inline.  Other overhead occurs when a pipeline of 'grep' output is passed to 'awk' only to print a field or two.&lt;BR /&gt;&lt;BR /&gt;I too, don't know of any direct way to get the epoch seconds other than calling a perl snippet.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 08 Aug 2006 07:04:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838985#M98841</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-08-08T07:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838986#M98842</link>
      <description>A variation on your theme would be to call Perl once to get the epoch seconds in ${EPOCH0} and then immediately store the shell variable $SECONDS as something like ${SECONDS0}. All your subsequent values would then be and no additional external calls would be needed:&lt;BR /&gt;&lt;BR /&gt;EPOCHNOW=$((${SECONDS} - ${SECONDS0} + ${EPOCH0}))&lt;BR /&gt; &lt;BR /&gt;It would be rather easy to create a function which was smart enough to call Perl if ${EPOCH0} were not set and to set ${SECONDS0} at the same time so that all of your script's actual use of the seconds would be to simply call this function.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Aug 2006 09:20:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838986#M98842</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-08T09:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838987#M98843</link>
      <description>Clay,&lt;BR /&gt; &lt;BR /&gt;nice workaround.&lt;BR /&gt;I have to revisit man sh-posix to find out if typeset -i can perform these "bigint" arithmetics.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Aug 2006 09:41:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838987#M98843</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2006-08-08T09:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838988#M98844</link>
      <description>Epoch seconds won't overflow 32-bit signed integers until 2038 so it's as safe as most current UNIX'es. I've done  thunk'ed about this some more and here is a pure shell equivalent that borrowed a function from another script.&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;cal_jdate() # expects 3 args: month, day, year; outputs truncated Julian Day&lt;BR /&gt;{&lt;BR /&gt;  typeset -i MO=${1}&lt;BR /&gt;  typeset -i DA=${2}&lt;BR /&gt;  typeset -i YR=${3}&lt;BR /&gt;  shift 3&lt;BR /&gt;  typeset -i JD=0&lt;BR /&gt;  JD=$((${DA} - 32075 + (1461 * (${YR} + 4800 + ((${MO} - 14)/12)) / 4) + \&lt;BR /&gt;         ((367 * (${MO} - 2 - ((${MO} - 14)/12) * 12))/12) - \&lt;BR /&gt;         ((3 * ((${YR} + 4900 + ((${MO} - 14)/12))/100))/4)))&lt;BR /&gt;  echo "${JD}"&lt;BR /&gt;  return 0&lt;BR /&gt;} # cal_jdate&lt;BR /&gt;&lt;BR /&gt;epoch()&lt;BR /&gt;{&lt;BR /&gt;  typeset -i MON=0&lt;BR /&gt;  typeset -i DAY=0&lt;BR /&gt;  typeset -i YEAR=0&lt;BR /&gt;  typeset -i HOUR=0&lt;BR /&gt;  typeset -i MIN=0&lt;BR /&gt;  typeset -i SEC=0&lt;BR /&gt;  typeset -i JD1970=2440588 # Julian Day of 1-Jan-1970&lt;BR /&gt;  date -u '+%m %d %Y %H %M %S' | read MON DAY YEAR HOUR MIN SEC&lt;BR /&gt;  typeset -i JD=$(( $(cal_jdate ${MON} ${DAY} ${YEAR}) - ${JD1970} ))&lt;BR /&gt;  typeset -i EP=$(((${JD} * 86400) + (${HOUR} * 3600) + (${MIN} * 60) + ${SEC}))&lt;BR /&gt;  echo "${EP}"&lt;BR /&gt;  return 0&lt;BR /&gt;} # epoch&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;typeset -i NOW=$(epoch)&lt;BR /&gt;echo "Epoch Seconds = ${NOW}"&lt;BR /&gt;&lt;BR /&gt;perl -e 'print "From Perl: ",time(),"\n"'&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Note that I call Perl immediately afterwards to make sure that they agree though obviously your production version would get rid of that perl line. This version too won't explode until 2038 (unless UNIX is fixed).&lt;BR /&gt;&lt;BR /&gt;This approach should work on all flavors of UNIX although on Linux I generally use zsh rather than bash because many versions of bash have problems with this construct:&lt;BR /&gt;&lt;BR /&gt;echo "One Two Three" | read A B C&lt;BR /&gt;echo "A=${A}"&lt;BR /&gt;echo "B=${B}"&lt;BR /&gt;echo "C=${C}"&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Aug 2006 10:08:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838988#M98844</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-08T10:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838989#M98845</link>
      <description>... and here is a little better implementation combining my 1st and 2nd ideas so that while it is a pure shell solution only calls the external date command once and caches the initial vales and then leverages $SECONDS for subsequent calls:&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# 08/08/2006 acs pure shell epoch seconds routine; caches data so that&lt;BR /&gt;#                date -u only needs to be called once but does depend upon&lt;BR /&gt;#                the ksh (and POSIX) built-in variable SECONDS&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;cal_jdate() # expects 3 args: month, day, year; outputs truncated Julian Day&lt;BR /&gt;{&lt;BR /&gt;  typeset -i MO=${1}&lt;BR /&gt;  typeset -i DA=${2}&lt;BR /&gt;  typeset -i YR=${3}&lt;BR /&gt;  shift 3&lt;BR /&gt;  typeset -i JD=0&lt;BR /&gt;  JD=$((${DA} - 32075 + (1461 * (${YR} + 4800 + ((${MO} - 14)/12)) / 4) + \&lt;BR /&gt;         ((367 * (${MO} - 2 - ((${MO} - 14)/12) * 12))/12) - \&lt;BR /&gt;         ((3 * ((${YR} + 4900 + ((${MO} - 14)/12))/100))/4)))&lt;BR /&gt;  echo "${JD}"&lt;BR /&gt;  return 0&lt;BR /&gt;} # cal_jdate&lt;BR /&gt;&lt;BR /&gt;typeset -i EPOCH=-1&lt;BR /&gt;typeset -i SECONDS0=-1&lt;BR /&gt;&lt;BR /&gt;epoch()    &lt;BR /&gt;{&lt;BR /&gt;  typeset -i EP=0&lt;BR /&gt;  if [[ ${EPOCH} -gt 0 ]]&lt;BR /&gt;    then&lt;BR /&gt;      EP=$((${SECONDS} - ${SECONDS0} + ${EPOCH}))&lt;BR /&gt;    else&lt;BR /&gt;      typeset -i MON=0&lt;BR /&gt;      typeset -i DAY=0&lt;BR /&gt;      typeset -i YEAR=0&lt;BR /&gt;      typeset -i HOUR=0&lt;BR /&gt;      typeset -i MIN=0&lt;BR /&gt;      typeset -i SEC=0&lt;BR /&gt;      typeset -i JD1970=2440588 # Julian Day of 1-Jan-1970&lt;BR /&gt;      date -u '+%m %d %Y %H %M %S' | read MON DAY YEAR HOUR MIN SEC&lt;BR /&gt;      typeset -i JD=$(( $(cal_jdate ${MON} ${DAY} ${YEAR}) - ${JD1970} ))&lt;BR /&gt;      EP=$(((${JD} * 86400) + (${HOUR} * 3600) + (${MIN} * 60) + ${SEC}))&lt;BR /&gt;      SECONDS0=${SECONDS}&lt;BR /&gt;      EPOCH=${EP}&lt;BR /&gt;    fi&lt;BR /&gt;  echo "${EP}"&lt;BR /&gt;  return 0&lt;BR /&gt;} # epoch&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;typeset -i NOW=$(epoch)&lt;BR /&gt;echo "Epoch Seconds = ${NOW}"&lt;BR /&gt;perl -e 'print "From Perl: ",time(),"\n"'&lt;BR /&gt;echo "Sleeping 10 seconds"&lt;BR /&gt;sleep 10&lt;BR /&gt;NOW=$(epoch)&lt;BR /&gt;echo "Epoch Seconds = ${NOW}"&lt;BR /&gt;perl -e 'print "From Perl: ",time(),"\n"'&lt;BR /&gt;&lt;BR /&gt;             &lt;BR /&gt;</description>
      <pubDate>Tue, 08 Aug 2006 13:54:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838989#M98845</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-08T13:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838990#M98846</link>
      <description>and an even slighty better version in that ${SECONDS0} is really not needed because ${SECONDS} can be subtracted one time for the current epoch seconds and cache that value.&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# 08/08/2006 acs pure shell epoch seconds routine; caches data so that&lt;BR /&gt;#                date -u need be called but once; requires that the shell&lt;BR /&gt;#                implement the built-in variable SECONDS&lt;BR /&gt;&lt;BR /&gt;cal_jdate() # expects 3 args: month, day, year; outputs truncated Julian Day&lt;BR /&gt;{&lt;BR /&gt;  typeset -i MO=${1}&lt;BR /&gt;  typeset -i DA=${2}&lt;BR /&gt;  typeset -i YR=${3}&lt;BR /&gt;  shift 3&lt;BR /&gt;  typeset -i JD=0&lt;BR /&gt;  JD=$((${DA} - 32075 + (1461 * (${YR} + 4800 + ((${MO} - 14)/12)) / 4) + \&lt;BR /&gt;         ((367 * (${MO} - 2 - ((${MO} - 14)/12) * 12))/12) - \&lt;BR /&gt;         ((3 * ((${YR} + 4900 + ((${MO} - 14)/12))/100))/4)))&lt;BR /&gt;  echo "${JD}"&lt;BR /&gt;  return 0&lt;BR /&gt;} # cal_jdate&lt;BR /&gt;&lt;BR /&gt;typeset -i EPOCH=-1&lt;BR /&gt;&lt;BR /&gt;epoch()&lt;BR /&gt;{&lt;BR /&gt;  typeset -i EP=0&lt;BR /&gt;  if [[ ${EPOCH} -gt 0 ]]&lt;BR /&gt;    then&lt;BR /&gt;      EP=$((${SECONDS} + ${EPOCH}))&lt;BR /&gt;    else&lt;BR /&gt;      typeset -i MON=0&lt;BR /&gt;      typeset -i DAY=0&lt;BR /&gt;      typeset -i YEAR=0&lt;BR /&gt;      typeset -i HOUR=0&lt;BR /&gt;      typeset -i MIN=0&lt;BR /&gt;      typeset -i SEC=0&lt;BR /&gt;      typeset -i JD1970=2440588 # Julian Day of 1-Jan-1970&lt;BR /&gt;      date -u '+%m %d %Y %H %M %S' | read MON DAY YEAR HOUR MIN SEC&lt;BR /&gt;      typeset -i JD=$(( $(cal_jdate ${MON} ${DAY} ${YEAR}) - ${JD1970} ))&lt;BR /&gt;      EP=$(((${JD} * 86400) + (${HOUR} * 3600) + (${MIN} * 60) + ${SEC}))&lt;BR /&gt;      EPOCH=$((${EP} - ${SECONDS}))&lt;BR /&gt;    fi&lt;BR /&gt;  echo "${EP}"&lt;BR /&gt;  return 0&lt;BR /&gt;} # epoch&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;typeset -i NOW=$(epoch)&lt;BR /&gt;echo "Epoch Seconds = ${NOW}"&lt;BR /&gt;perl -e 'print "From Perl: ",time(),"\n"'&lt;BR /&gt;echo "Sleeping 10 seconds"&lt;BR /&gt;sleep 10&lt;BR /&gt;NOW=$(epoch)&lt;BR /&gt;echo "Epoch Seconds = ${NOW}"&lt;BR /&gt;perl -e 'print "From Perl: ",time(),"\n"'&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Aug 2006 14:07:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838990#M98846</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-08T14:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838991#M98847</link>
      <description>&lt;!--!*#--&gt;How about creating your own executable and use it in place of date whenever you need to get the seconds since the Unix epoch...since the program needs minimal coding and can be placed and invoked from the /usr/local/bin directory.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;TIME.H&gt;&lt;BR /&gt;&lt;BR /&gt;main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;    time_t tloc, *ptloc = &amp;amp;tloc;&lt;BR /&gt;    printf("seconds since epoch: %ld\n", time(ptloc));&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;...compile and execute as&lt;BR /&gt;&lt;BR /&gt;# cc -o epochsecs epochsecs.c&lt;BR /&gt;# /usr/local/bin/epochsecs&lt;/TIME.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 08 Aug 2006 14:26:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838991#M98847</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-08-08T14:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838992#M98848</link>
      <description>The whole point is to avoid exec's and the use of non-standard commands. Coding a small c program is no different that simply perl -e 'print time'.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Aug 2006 14:33:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838992#M98848</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-08T14:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838993#M98849</link>
      <description>&lt;P&gt;&amp;gt;Sandman!:&amp;nbsp; printf("%ld\n", time(ptloc));&lt;BR /&gt;&lt;BR /&gt;There is no need to pass a parm to time(2). This also makes the kernel sweat because it has to validate it. Just use time(NULL).&lt;/P&gt;</description>
      <pubDate>Sat, 29 Oct 2011 08:27:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838993#M98849</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-29T08:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838994#M98850</link>
      <description>Hello Guys,&lt;BR /&gt;  &lt;BR /&gt;many thanks for all the efforts you took further elaborating on my somewhat idle query.&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Aug 2006 07:24:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838994#M98850</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2006-08-09T07:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: HP-UX shell or OE access to epoch secs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838995#M98851</link>
      <description>&lt;!--!*#--&gt;Not actually Laurie, but wanted to share a similar solution to Clays but hopefully easier for them young folk to support once I am gone (first version used bc(1) just because I wanted to try :-):&lt;BR /&gt;&lt;BR /&gt;function secsFromEpoch {&lt;BR /&gt;&lt;BR /&gt;#  Good until 2100&lt;BR /&gt;&lt;BR /&gt;  typeset -i year=0&lt;BR /&gt;  typeset -i jDay=0&lt;BR /&gt;  typeset -i hour=0&lt;BR /&gt;  typeset -i min=0&lt;BR /&gt;  typeset -i sec=0&lt;BR /&gt;  typeset -i totalDays=0&lt;BR /&gt;  typeset -i totalHours=0&lt;BR /&gt;  typeset -i totalMinutes=0&lt;BR /&gt;  typeset -i totalSeconds=0&lt;BR /&gt;&lt;BR /&gt;  date -u +"%Y %j %H %M %S" | read year jDay hour min sec&lt;BR /&gt;&lt;BR /&gt;  (( totalDays = ($year - 1970)*365 + ($year - 1968)/4 + $jDay - 1 ))&lt;BR /&gt;  (( totalHours = $totalDays*24 + $hour ))&lt;BR /&gt;  (( totalMinutes = $totalHours*60 + $min ))&lt;BR /&gt;  (( totalSeconds = $totalMinutes*60 + $sec ))&lt;BR /&gt; &lt;BR /&gt;  echo $totalSeconds&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Oct 2006 19:19:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/hp-ux-shell-or-oe-access-to-epoch-secs/m-p/3838995#M98851</guid>
      <dc:creator>HP Technology Forum gue</dc:creator>
      <dc:date>2006-10-05T19:19:09Z</dc:date>
    </item>
  </channel>
</rss>

