Operating System - HP-UX
1745877 Members
4281 Online
108723 Solutions
New Discussion юеВ

Re: convert human readable to epoch secs

 
SOLVED
Go to solution
Shabu Khan-2
Frequent Advisor

Re: convert human readable to epoch secs

Thanks JRF.
It works from 01 thru 07, when I remove the '0' for 08 and 09 it works, may be I can sed out the 0 when it is 08 and 09 ...

Any other conditions I need to be aware of?
James R. Ferguson
Acclaimed Contributor

Re: convert human readable to epoch secs

Hi (again):

> may be I can sed out the 0 when it is 08 and 09 ...Any other conditions I need to be aware of?

Ridding the shell variables of leading zeros will eliminate your problem. The Perl script I offered eliminates the shell snipping, filtering and multiple variables, though.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: convert human readable to epoch secs

>maybe I can sed out the 0 when it is 08 and 09

You can also use typeset: typeset -LZ var="09"