File: pwho

package info (click to toggle)
libsys-utmp-perl 1.6-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 116 kB
  • ctags: 10
  • sloc: perl: 237; makefile: 40
file content (19 lines) | stat: -rwxr-xr-x 341 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl -w

use Sys::Utmp ;
use POSIX qw(strftime);
use strict;

my $utmp = Sys::Utmp->new();


while (my $utent = $utmp->getutent()) 
{ 

    if ( $utent->user_process() )
    {
       print $utent->ut_user(),"\t",
             $utent->ut_line(),"\t",
             strftime("%b %d %I:%M",localtime($utent->ut_time())),"\n";
    }
}