summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/eg/who
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/eg/who')
-rw-r--r--contrib/perl5/eg/who13
1 files changed, 0 insertions, 13 deletions
diff --git a/contrib/perl5/eg/who b/contrib/perl5/eg/who
deleted file mode 100644
index ac15246..0000000
--- a/contrib/perl5/eg/who
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/perl
-# This assumes your /etc/utmp file looks like ours
-open(UTMP,'/etc/utmp');
-@mo = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
-while (read(UTMP,$utmp,36)) {
- ($line,$name,$host,$time) = unpack('A8A8A16l',$utmp);
- if ($name) {
- $host = "($host)" if ord($host);
- ($sec,$min,$hour,$mday,$mon) = localtime($time);
- printf "%-9s%-8s%s %2d %02d:%02d %s\n",
- $name,$line,$mo[$mon],$mday,$hour,$min,$host;
- }
-}
OpenPOWER on IntegriCloud