Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # HP-UX & Linux (RedHat) Cross Platform Script
- if [ `uname` = "HP-UX" ]; then
- SYSLOG=/var/adm/syslog/syslog.log
- else
- SYSLOG=/var/log/user
- fi
- datetime()
- {
- if [ `uname` = "HP-UX" ]; then
- perl -e 'use Time::HiRes qw(gettimeofday); my($fullSec,$microsec)=gettimeofday(); my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($fullSec); printf("%04d/%02d/%02d %02d:%02d:%02d.%03d",$year+1900,$mon+1,$mday,$hour,$min,$sec,$microsec/1000);'
- else
- date +"%Y/%m/%d %H:%M:%S.%N" | cut -b-23
- fi
- }
- datetimenumber()
- {
- if [ `uname` = "HP-UX" ]; then
- perl -e 'use Time::HiRes qw(gettimeofday); my($fullSec,$microsec)=gettimeofday(); my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($fullSec); printf("%04d%02d%02d%02d%02d%02d%03d",$year+1900,$mon+1,$mday,$hour,$min,$sec,$microsec/1000);'
- else
- date +"%Y%m%d%H%M%S%N" | cut -b-17
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement