Antwort: [hobbit] RE: Antwort: [hobbit] RE: V0.2.0 of adminscripts
True but I believe that solaris comes with perl and old one but one should handle the date stuff. Atlest the one system I found here that does have an update perl reports sun pkg SUNWpl5u, Can any one confirm this? And can anyone supply the code to do a timestamp like the GNU date +%s ? a one liner hopefull (like perl -e '$date=localtime(time); print "$date \n" ;' )
Yes but than must perl available.
I think i include an switch in the next version which test what is available and what not.
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| _p_ Mike Nemeth
| ___| |_____ email(w) michael.nemeth at lmco.com Work: 856 359-1425
|><___________) | Home Page:http://www.geocities.com/mjnemeth/
| Work Page:http://scorpion/~nemethm/
| Work Page:http://ortfsb/~mnemeth/
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On Tue, Jan 09, 2007 at 08:33:37AM -0500, Michael Nemeth wrote:
True but I believe that solaris comes with perl and old one but one should handle the date stuff. Atlest the one system I found here that does have an update perl reports sun pkg SUNWpl5u, Can any one confirm this? And can anyone supply the code to do a timestamp like the GNU date +%s ?
If there is no other way, this program (compiled on Solaris 8) will do it. Save the attachment, then:
$ uudecode tstamp.uue $ gunzip tstamp.gz $ ls -l tstamp -rwxr-xr-x 1 hstoerne other 3772 Jan 9 15:17 tstamp $ ./tstamp 1168352286
Source code for this utility is a whopping 7 lines:
#include <time.h> #include <stdio.h> int main(int argc, char **argv) { printf("%d\n", (int) time(NULL)); return 0; }
Henrik
Hi, stupid question (i can't test this script today), run this precompiled Script on all solaris systems?
thx Stefan
Hi, its is not difficult to create an timestamp but to create an timestamp like date it does is difficult:
perl -e 'use Date::Manip qw(ParseDate UnixDate);$date=&ParseDate("2007/01/08 15:45");print(UnixDate( $date , "%s" ));'
is one thing i have found but my solaris 9 don't Support it. Does anyone know an other solution to transform
2007/01/08 15:45
to
1168267500
Can someone test my solution on Solaris 10 or other Unixes?
thx Stefan
participants (3)
-
henrik@hswn.dk
-
michael.nemeth@lmco.com
-
stefan.freisler@aspect-online.de