Hi Kennedy:
This should meet your needs. For simplicity, granularity is to whole days (without regard to hours and minutes). The year of the activity is assumed to be the current year, since the 'sulog' doesn't record a date with a year.
# cat ./sulog30
#!/usr/bin/perl
use strict;
use warnings;
use Time::Local;
my ( $fh, $mon, $mday, $time1, $time2 );
open( $fh, '<', '/var/adm/sulog' ) or die "Can't open sulog: $!\n";
$time1 = time();
while (<$fh>) {
( $mon, $mday ) = split "/", (split)[1];
$time2 = timelocal( 0, 0, 0, $mday, $mon - 1, (localtime)[5] );
print if ( ( $time1 - $time2 ) <= ( 60 * 60 * 24 * 31 ) );
}
1;
...simply run as:
# ./sulog30
Regards!
...JRF...