12-17-04 12:45 AM
Tom Brehony wrote:
> The subject lines says it all. I am looking for a script (ideally Korn
> Shell)
> to extract from /etc/security/lastlog a list of users and their last login
> time
> in human readable format.
>
> I have seen PERL scripts to convert the Unix time in seconds to a human
> readable form, but I do not have PERL installed on the AIX 4.2 box
> I am using and I am not familiar with PERL anyway and would not be
> able to modify the script to do what I need.
>
> Anyone have something that will do this?
>
> Tom.
>
>
If using /etc/passwd you can do
for user in `cat /etc/passwd |cut -d : -f 1 |sort`
do
last $user|head -1
done
If using NIS you can do
for user in `ypcat passwd |cut -d : -f 1 |sort`
do
last $user|head -1
done
patrick
[ Post a follow-up to this message ]
|