#!/usr/local/bin/rexx
PARSE ARG usr kf

IF DATATYPE(kf)<>'NUM' THEN kf=1
IF usr='' THEN usr='marijan liveman'


DO i=1 TO kf
idioti=usr
DO uu=1 TO WORDS(idioti)
PARSE VAR idioti user idioti
   'w | grep 'user'>FIFO'
   n=0;
   DO WHILE QUEUED()>0
      PARSE PULL user tty .
      n=n+1
      tt.n=tty
   END
   DO i=1 TO n
      'ps -aux | grep 'RIGHT(tt.i, 2)' >LIFO'
   END 
   IF QUEUED()>0 THEN DO
      DO WHILE QUEUED()>0
         PARSE PULL . pid . 
         END
      END
   IF DATATYPE(pid)='NUM' THEN 
      'kill -9' pid
   sleep(1)
END
END

