Hi all,
I have used a bash script which ultimately converts a string into date using date --date option:
DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings
TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime
but i'm not able to convert it into a ksh equivalent.So can anybody help me to do so?
What do you exactly mean by ksh equivalent? The date tool that you've used in your bash script is a utility installed on your system running HP-UX, and not a shell feature specific to bash.. You may invoke it from ksh as much you did from bash, if that's what your concern is all about.
where 'date --date' is converting the string $DATE into its epoch time (in sec) but in ksh there is no such option with date.
As another limitation I can't download ksh93 or any higher version.I'm currently having ksh88 installed in HPUX machine .If its not possible in ksh script then can i accomplish it using any perl script?
I'm not sure if you understood post #2 and post #3.
In perl, you may use the timelocal routine from Time::Local module to get the time in seconds since epoch. Check the perldocs for instructions on how to implement the same.