I have these codes working fine in AIX 5.2,
#!/usr/bin/perl
open (PASSWD,"/etc/passwd") or die "Cannot open /etc/passwd: $!\n";
while (<PASSWD>) {
($user,undef,$uid,undef,$name,undef)=split ":";
if ($uid > 203 and $uid < 1000) {
if ($name eq "") { $name = "Unknown"; }
$last = `lsuser -a time_last_login $user`;
if ($last !~ /time_last_login/) {
$date="Unknown";
$otime="";
$time=0;
} else {
(undef,$time)=split("=",$last);
($seconds,$minutes,$hours,$day,$month,$year,undef) = localtime($time);
$month += 1;
$year += 1900;
$date="$month/$day/$year";
$otime="$hours:$minutes:$seconds";
}
write;
}
}
format =
@<<<<<<<<<< @<<<<<<< @>>> @<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<
$time, $user, $uid,$name, $date, $otime
.
but, if I run these in AIX 5.3, I am getting the messages below and inaccurate results.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC__FASTMSG = "true",
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
I have the settings as shown below:
# env LANG
en_US
# env LC__FASTMSG
true
# env LC_ALL
LC_ALL: No such file or directory
I am not sure what I am missing.
Pls advise.
thx much
#!/usr/bin/perl
open (PASSWD,"/etc/passwd") or die "Cannot open /etc/passwd: $!\n";
while (<PASSWD>) {
($user,undef,$uid,undef,$name,undef)=split ":";
if ($uid > 203 and $uid < 1000) {
if ($name eq "") { $name = "Unknown"; }
$last = `lsuser -a time_last_login $user`;
if ($last !~ /time_last_login/) {
$date="Unknown";
$otime="";
$time=0;
} else {
(undef,$time)=split("=",$last);
($seconds,$minutes,$hours,$day,$month,$year,undef) = localtime($time);
$month += 1;
$year += 1900;
$date="$month/$day/$year";
$otime="$hours:$minutes:$seconds";
}
write;
}
}
format =
@<<<<<<<<<< @<<<<<<< @>>> @<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<
$time, $user, $uid,$name, $date, $otime
.
but, if I run these in AIX 5.3, I am getting the messages below and inaccurate results.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC__FASTMSG = "true",
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
Attribute "time_last_login" is not valid.
I have the settings as shown below:
# env LANG
en_US
# env LC__FASTMSG
true
# env LC_ALL
LC_ALL: No such file or directory
I am not sure what I am missing.
Pls advise.
thx much