08-10-2010 10:19 PM
According to it there is no format option +%s. However when I run this command:
I get a correct result:
Why do you not include this format option in your documentation?
Solved! Go to Solution.
08-10-2010 11:10 PM
The document you were reading is the first edition of HP-UX 11.11 man pages, published in December 2000. It's almost 10 years old.
I'm pretty sure this functionality didn't exist in 11.11 in about 2002/2003. I guess it may have been added by some patch after that. At that time, I wrote a tiny C program to overcome the problem.
Which version of HP-UX you're using? ("uname -a" please)
If the option exists but the installed manpage for date(1) on your system doesn't know about it, then it can be said it's a documentation bug.
08-10-2010 11:31 PM
command referene, it is good that you found it, HP may include it in the next KB Knowledge base document,
http://docs.hp.com/en/B2355-91017/B2355-91017.pdf ## Page 205 (11.31)
date - display or set the date and time
08-11-2010 02:15 PM
08-11-2010 02:25 PM
> Bill: Based on some average 11.00, 11.11, 11.23 and 11.31 systems, date %s works starting with 11.23 and fails in anything prior.
And in that case, since all of the aforementioned releases had Perl, simply do:
# perl -le 'print time()'