Hi wisecracker,
You suspected correctly. The POSIX date
utility does not have a -r
option and the POSIX date
utility does not have a %s
format specifier. There are plans to add the %s
format specifier in the next revision of the standard. So far, no one has requested adding date -r
to the standard.
With standard implementations of awk
, you can get the number of seconds since the Epoch (i.e. midnight at the start of January 1, 1970 GMT) using the command:
awk 'BEGIN{print srand(srand())}'
The perl
code that Corona688 suggested in post #17 in this thread is probably the best bet on HP-UX, but, of course, perl
isn't in the standard either. Nonetheless, perl
is almost surely available for HP-UX from HP even though it isn't standard.
And, kmarcus, I apologize for post #18. I had already asked that question before in post #2 a month ago and you answered it in post #3. :o