I take it that you did discover how to get input to the program.
Since we are having this discussion on Linux
Questions.org, not surprisingly I am using gawk
on Linux; yes systime
() and mktime
() are from gawk
Given that you are using SunOS, I understand that you may wish to use only things that come with it to script a task. But just in case you might be open to something else, I should mention that some people have installed and run gawk
successfully on SunOS.
output which shows SunOS 5.10, means you've got what, Solaris 10?
I'm sorry but at the moment I'm not able to fire up my old Sparc machines, and even if I were, they run much older versions of Solaris. So I have no way of testing anything on a live Solaris 10 machine.
I considered writing replacement systime
() and mktime
() functions to work with nawk
on Solaris. That would rely on output from the Solaris date
command. The date
command on Linux has the necessary capabilities. But according to Oracle's on-line man pages, the date
command on Solaris 10 doesn't seem to have what's needed.
Since I've used perl
on much older versions of Solaris, and Oracle shows a man page for perl
with Solaris 10, you should be able to use a perl
I've attached one I tested on Linux with the data you provided. In principle, the perl
on Solaris 10 should be new enough to handle the capabilities I used in the script.
BTW, if you are going to ask non
-Linux questions on Linux
Questions.org, AFAIK, the Programming forum might be appropriate. If have questions that are somewhat specific to Solaris, there are other sites which might be more helpful . For example, there is a Solaris forum at http://www.unix.com/
Hope this helps.