#!/usr/athena/bin/perl
open (FI, "/usr/tmp/.zwho") || die "Couldn't open file";

if ($ARGV[0] eq "-i") {
	$i++;
	shift @ARGV;
}
while (<FI>) {
	($name, $time, $inst) = split;
	if (!($i && (@ARGV[0] ne $inst))) {
	$LTIM{$name} = $time;
	$LINS{$name} = $inst;
	}
}
sub alpha { $a cmp $b; }

while (($user, $last) = each %LTIM) {
	$where = $LINS{$user};
	print"$user at $last on $where\n";
}
