Operating System - HP-UX
1753962 Members
7495 Online
108811 Solutions
New Discussion юеВ

Re: Is there an HP supported version of the "date"command which has the -yesterday option?

 
SOLVED
Go to solution
Kevin Nikiforuk
Valued Contributor

Is there an HP supported version of the "date"command which has the -yesterday option?

Is there an HP supported version of the "date"command which has the -yesterday option?

6 REPLIES 6
RAC_1
Honored Contributor

Re: Is there an HP supported version of the "date"command which has the -yesterday option?

NO....

gnu date command has that option.
There is no substitute to HARDWORK
Kevin Nikiforuk
Valued Contributor

Re: Is there an HP supported version of the "date"command which has the -yesterday option?

Thanks for the reply.

But I've heard HP supports some GNU commands. Any way to verify if the GNU date command is supported?

Cheers
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Is there an HP supported version of the "date"command which has the -yesterday option?

The Gnu version is not supported by HP nor should it be; it is freely available from any of the HP-UX Porting Centre's so check the licensing and agreements there.

If you must use HP "supported" tools then use Perl. A combination of time() - 86400 + the localtime (or strftime) function will do anything the date command will do.
If it ain't broke, I can fix that.
H.Merijn Brand (procura
Honored Contributor

Re: Is there an HP supported version of the "date"command which has the -yesterday option?

As you could also have read in http://mirrors.develooper.com/hpux/faq.html

--8<---
* How do I print Yesterday?

d3:/ 102 > echo 'Yesterday'
Yesterday
d3:/ 103 > perl -le 'print scalar localtime time - 86400'

Or use A.Clay Stephenson's date hammer, which can also be used for more complicated actions from the command line, as will using the modules Date::Calc or Date::Manip with Perl.
-->8---

A.Clay's valuable date hammer can be found on several places on this forum. It is available in either a widely supported Perl version or an even more widely supported shell version. Both also available on my site (follow the lnks in that FAQ page)

BTW GNU date (in GNU coreutils) available at http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-5.2.1/ also by HP

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kevin Nikiforuk
Valued Contributor

Re: Is there an HP supported version of the "date"command which has the -yesterday option?

procura,

Thank you for that. That's an extremely easy statement to embed in my shell scripts.

Gregory Fruth
Esteemed Contributor

Re: Is there an HP supported version of the "date"command which has the -yesterday option?

Perhaps you're referring to the "HP
Internet Express" package. It mostly
consists of higher-level packages like
Eclipse, Samba, etc. though it does
include a few lower-level items like
bash and vim:

http://www.hp.com/products1/unix/operating/internet/express.html
http://www.docs.hp.com/en/5991-0748/index.html

The Linux porting kit and STK might also
contain some GNU tools:

http://devrsrc1.external.hp.com/LPK/
http://devrsrc1.external.hp.com/STKL/index.html