Re: Need script to extract from /etc/security/lastlog -> list of
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > Re: Need script to extract from /etc/security/lastlog -> list of




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Need script to extract from /etc/security/lastlog -> list of  
Patrick Begou


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:58 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register