#!/usr/local/bin/rexx

PARSE arg ko gde

'finger 'ko'@'gde '>FIFO'
mes=""
max=QUEUED()
DO i=1 TO max
   PARSE UPPER PULL s w rest
   IF s="LAST" THEN DO
      IF w="NT" THEN DO
      PARSE VAR rest .',' mes dan ',' . . sat .
      END 
      IF w='LOGIN' THEN DO
      PARSE VAR REST . . mes dan sat .
      END      
   END 
END 
IF mes<>'' THEN Say dan LEFT(mes, 3) sat
ELSE SAY '-'

EXIT
